* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.card {
  width: min(520px, calc(100% - 32px));
  margin: 48px auto;
  padding: 28px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
}

h1 {
  margin-top: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 16px;
}

button,
.button {
  display: inline-block;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: #111827;
  color: white;
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.muted {
  color: #6b7280;
}

.error,
.notice,
.success,
.paybox {
  padding: 14px;
  border-radius: 12px;
  margin: 16px 0;
}

.error {
  background: #fee2e2;
  color: #991b1b;
}

.notice {
  background: #fef3c7;
  color: #92400e;
}

.success {
  background: #dcfce7;
  color: #166534;
}

.paybox {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.instructions {
  margin-top: 28px;
}

.instructions h2 {
  margin-top: 0;
}

.instructions ol {
  padding-left: 22px;
  line-height: 1.55;
}

.instructions li {
  margin-bottom: 16px;
}

.os-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.os-grid a {
  display: block;
  padding: 14px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid #e5e7eb;
}

.os-grid a:hover {
  background: #e5e7eb;
}

.os-grid span {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-weight: 400;
  font-size: 14px;
}

@media (min-width: 640px) {
  .os-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card.wide {
  width: min(860px, calc(100% - 32px));
}

.small {
  font-size: 14px;
}

.section {
  margin-top: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.topbar form {
  min-width: 120px;
}

.secondary {
  background: #e5e7eb;
  color: #111827;
}

.secondary-link {
  margin-top: 16px;
  background: #e5e7eb;
  color: #111827;
}

.client-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.client-card {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}

.client-card h3 {
  margin-top: 0;
}

.instructions {
  margin-top: 28px;
}

.instructions h2 {
  margin-top: 0;
}

.instructions ol {
  padding-left: 22px;
  line-height: 1.55;
}

.instructions li {
  margin-bottom: 16px;
}

.os-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.os-grid a {
  display: block;
  padding: 14px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid #e5e7eb;
}

.os-grid a:hover {
  background: #e5e7eb;
}

.os-grid span {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-weight: 400;
  font-size: 14px;
}

@media (min-width: 640px) {
  .client-list {
    grid-template-columns: 1fr 1fr;
  }

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

.links-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.links-row a {
  color: #111827;
  font-weight: 700;
  text-decoration: none;
}

.links-row a:hover {
  text-decoration: underline;
}

.admin-wide {
  width: min(1180px, calc(100% - 32px));
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-topbar form {
  width: auto;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.admin-nav a {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid #e5e7eb;
}

.admin-nav a:hover {
  background: #e5e7eb;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.stat-card {
  padding: 16px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.stat-card b {
  display: block;
  font-size: 28px;
}

.stat-card span {
  color: #6b7280;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f9fafb;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 12px;
  font-weight: 700;
}

.success-badge {
  background: #dcfce7;
  color: #166534;
}

.danger-badge {
  background: #fee2e2;
  color: #991b1b;
}

.inline-form {
  display: inline-block;
  width: auto;
  margin: 2px;
}

.small-btn {
  width: auto;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
}

.small-btn.danger {
  background: #991b1b;
}

@media (min-width: 720px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.small-link-btn {
  display: inline-block;
  width: auto;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  background: #111827;
  color: white;
  text-decoration: none;
  margin: 2px;
}
