:root {
  --bg: #f3f6fb;
  --panel: #fff;
  --line: #dfe7f1;
  --text: #10233f;
  --muted: #667892;
  --primary: #1769e0;
  --green: #138a58;
  --yellow: #b77900;
  --red: #cf3240;
  --purple: #7048c8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.45 "Segoe UI",
    Arial,
    sans-serif;
}
.topbar {
  height: 68px;
  padding: 0 4vw;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 3;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1268e7, #6a45da);
  color: #fff;
  font-size: 13px;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.topbar nav a,
.link-button {
  border: 0;
  background: none;
  color: #405575;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.topbar form {
  margin: 0;
}
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 3vw 60px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}
.page-heading h1 {
  font-size: 27px;
  margin: 5px 0;
}
.page-heading p,
.panel-title p {
  margin: 0;
  color: var(--muted);
}
.back {
  color: var(--primary);
  text-decoration: none;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  background: #fff;
  color: #173250;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.button.danger {
  color: #b42330;
  border-color: #f0b7bd;
}
.button.full {
  width: 100%;
}
.success-button {
  color: var(--green);
  border-color: #9fd9c0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stats article {
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 8px #1b35520a;
}
.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stats strong {
  font-size: 25px;
  display: block;
  margin-top: 4px;
}
.stats .green strong {
  color: var(--green);
}
.stats .yellow strong {
  color: var(--yellow);
}
.stats .red strong {
  color: var(--red);
}
.stats .purple strong {
  color: var(--purple);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px #1b355208;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel h2 {
  font-size: 18px;
  margin: 0;
}
.search {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.search input {
  max-width: 440px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  color: #6b7d96;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 13px 10px;
  border-bottom: 1px solid #edf1f6;
  vertical-align: middle;
}
td small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.customer-link {
  font-weight: 700;
  color: #183b68;
  text-decoration: none;
}
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 99px;
  background: #edf2f7;
  color: #53657c;
  font-size: 11px;
  font-weight: 700;
}
.badge.active,
.badge.paid {
  background: #dcf7e9;
  color: #087343;
}
.badge.grace,
.badge.pending {
  background: #fff1c9;
  color: #8a5d00;
}
.badge.blocked,
.badge.suspended {
  background: #ffe0e3;
  color: #ae1d2b;
}
.badge.deactivated {
  background: #e8edf3;
  color: #68788d;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 35px;
}
.alert {
  padding: 13px 16px;
  border-radius: 9px;
  margin-bottom: 17px;
}
.alert.success {
  background: #dcf7e9;
  color: #0c6e44;
}
.alert.error,
.validation {
  background: #ffe3e6;
  color: #a71e2b;
}
.validation:empty {
  display: none;
}
.form-panel {
  max-width: 1050px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.form-grid label {
  display: block;
  color: #435672;
  font-size: 12px;
  font-weight: 600;
}
.form-grid input,
.form-grid select,
.form-grid textarea,
.search input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid #cbd7e6;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.form-grid label span {
  color: var(--red);
  font-weight: 400;
}
.span-2 {
  grid-column: span 2;
}
.span-3 {
  grid-column: span 3;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.two-columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
.payment-form .form-actions {
  margin-top: 0;
}
.info-list {
  margin: 0;
}
.info-list div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f6;
}
.info-list dt {
  color: var(--muted);
}
.info-list dd {
  text-align: right;
  margin: 0;
}
.stack-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.activation-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 20px;
  margin-bottom: 20px;
  border: 1px solid #94bff7;
  border-radius: 11px;
  background: #eef6ff;
}
.activation-box p {
  margin: 3px 0 0;
  color: var(--muted);
}
.activation-box code {
  font-size: 17px;
  font-weight: 700;
  color: #0d57bc;
  user-select: all;
}
.status-text.active {
  color: var(--green);
}
.status-text.grace {
  color: var(--yellow);
}
.status-text.blocked,
.status-text.suspended {
  color: var(--red);
}
.link-danger {
  border: 0;
  background: none;
  color: var(--red);
  cursor: pointer;
}
.audit-list > div {
  padding: 12px 0;
  border-bottom: 1px solid #edf1f6;
}
.audit-list span {
  float: right;
  color: var(--muted);
  font-size: 12px;
}
.audit-list p {
  margin: 4px 0;
  color: var(--muted);
}
summary {
  cursor: pointer;
  font-weight: 700;
}
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 10% 10%, #dceaff, transparent 32%), var(--bg);
}
.login-card {
  width: min(420px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px;
  box-shadow: 0 22px 60px #24456a22;
}
.login-brand {
  margin-bottom: 27px;
}
.login-card h1 {
  margin: 0 0 5px;
}
.login-card > p {
  color: var(--muted);
  margin: 0 0 22px;
}
.login-card label {
  display: block;
  margin: 14px 0;
  color: #435672;
  font-weight: 600;
}
.login-card input {
  display: block;
  width: 100%;
  padding: 11px;
  margin-top: 6px;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
}
.login-card .button {
  margin-top: 8px;
}
@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-columns {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .span-2,
  .span-3 {
    grid-column: span 1;
  }
  .topbar nav a {
    display: none;
  }
}
@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 20px 14px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 15px;
  }
  .activation-box {
    display: block;
  }
  .activation-box code {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    word-break: break-all;
  }
}
