:root {
  --primary: #1E56CD;
  --background: #F7FCFE;
  --card: #FFFFFF;
  --text: #111827;
  --muted: #6B7280;
  --border: #E5E7EB;
  --success: #16A34A;
  --danger: #DC2626;
  --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

code {
  background: #F3F4F6;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}

.home,
.not-found,
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.home {
  grid-template-rows: 1fr auto;
}

.home-panel,
.auth-card {
  width: min(100%, 560px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 40px;
  text-align: center;
}

.auth-card {
  text-align: left;
}

.home-panel h1,
.auth-card h1 {
  margin: 8px 0 12px;
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-card h1 {
  font-size: 28px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

.lead {
  margin: 0 auto 24px;
  color: var(--muted);
  max-width: 440px;
}

.home-footer {
  padding: 18px 0;
  font-size: 14px;
}

.brand {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  font-size: 20px;
  font-weight: 800;
}

.brand.center {
  display: block;
  text-align: center;
  margin-bottom: 16px;
}

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  text-decoration: none;
}

.button.primary {
  background: var(--primary);
  color: #FFFFFF;
}

.button.secondary {
  background: #FFFFFF;
  border-color: var(--border);
  color: var(--text);
}

.button.danger {
  background: var(--danger);
  color: #FFFFFF;
}

.button.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

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

.sidebar {
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav a {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 12px;
}

.nav a.active,
.nav a:hover {
  background: #EEF4FF;
  color: var(--primary);
  text-decoration: none;
}

.main {
  padding: 28px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 30px;
  letter-spacing: 0;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 20px;
}

.stats-grid,
.grid-two {
  display: grid;
  gap: 16px;
}

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

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

.stat span {
  color: var(--muted);
  display: block;
  font-weight: 700;
  font-size: 14px;
}

.stat strong {
  display: block;
  font-size: 32px;
  line-height: 1.1;
  margin-top: 8px;
}

.section-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.section-head p {
  margin: 4px 0 0;
}

.actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions form {
  margin: 0;
}

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

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

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

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

.truncate {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.badge.success {
  background: #DCFCE7;
  color: var(--success);
}

.badge.muted {
  background: #F3F4F6;
  color: var(--muted);
}

.alert {
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.alert p {
  margin: 0;
}

.alert p + p {
  margin-top: 4px;
}

.alert.success {
  background: #ECFDF5;
  border: 1px solid #BBF7D0;
  color: #166534;
}

.alert.danger {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

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

.simple-list {
  display: grid;
  gap: 10px;
}

.simple-list a,
.simple-list span {
  align-items: center;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
}

canvas {
  display: block;
  height: 280px !important;
  width: 100% !important;
}

label {
  color: var(--text);
  display: grid;
  font-weight: 700;
  gap: 7px;
  margin-bottom: 14px;
}

input,
textarea {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  width: 100%;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(30, 86, 205, 0.14);
}

.check-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.check-row input {
  width: auto;
}

.form-card {
  max-width: 760px;
}

.info-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  margin: 0;
}

.info-list dt {
  color: var(--muted);
  font-weight: 700;
}

.info-list dd {
  margin: 0;
}

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

  .sidebar {
    height: auto;
    padding: 16px;
    position: static;
  }

  .nav {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav a {
    flex: 0 0 auto;
  }

  .main {
    padding: 18px;
  }

  .stats-grid,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .home-panel,
  .auth-card {
    padding: 28px;
  }

  .home-panel h1 {
    font-size: 34px;
  }

  .section-head {
    display: grid;
  }

  .info-list {
    grid-template-columns: 1fr;
  }
}

