/* ==========================================================================
   DreamHost Billing — portal, auth, checkout and admin UI
   Loaded after site.css (shared tokens, brand, buttons and public pages).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Small shared additions
   -------------------------------------------------------------------------- */

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

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

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

.text-link {
  color: #9db8ff;
  border-bottom: 1px solid rgba(120, 155, 255, 0.35);
  transition: color 0.2s, border-color 0.2s;
}

.text-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.text-success { color: var(--cyan); }
.text-danger { color: #ff9aac; }
.text-warning { color: var(--amber); }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  letter-spacing: 0.02em;
}

.is-hidden {
  display: none !important;
}

.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 22px 0;
}

.nav-login {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-login:hover {
  color: var(--text);
}

.public-flashes {
  padding-top: 22px;
}

@media (max-width: 880px) {
  .nav-login {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Buttons, badges, alerts
   -------------------------------------------------------------------------- */

.btn-xs {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
}

.btn-sm {
  height: 40px;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  border-color: rgba(255, 108, 132, 0.32);
  background: rgba(255, 92, 120, 0.09);
  color: #ffb3c1;
}

.btn-danger:hover {
  border-color: rgba(255, 108, 132, 0.6);
  background: rgba(255, 92, 120, 0.16);
  transform: translateY(-1px);
}

.btn-outline {
  border-color: rgba(120, 155, 255, 0.48);
  background: transparent;
  color: #b8ccff;
}

.btn-outline:hover {
  border-color: rgba(120, 155, 255, 0.8);
  background: rgba(91, 140, 255, 0.09);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-success {
  border-color: rgba(55, 230, 201, 0.28);
  background: rgba(55, 230, 201, 0.09);
  color: #9ff0e0;
}

.badge-warning {
  border-color: rgba(255, 196, 107, 0.3);
  background: rgba(255, 196, 107, 0.09);
  color: #ffd596;
}

.badge-danger {
  border-color: rgba(255, 108, 132, 0.3);
  background: rgba(255, 108, 132, 0.09);
  color: #ffb3c1;
}

.badge-muted {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.badge-info {
  border-color: rgba(91, 140, 255, 0.32);
  background: rgba(91, 140, 255, 0.1);
  color: #b6ccff;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.alert .ic {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  flex: none;
}

.alert + .alert {
  margin-top: 10px;
}

.alert-success {
  border-color: rgba(55, 230, 201, 0.28);
  background: rgba(55, 230, 201, 0.07);
}

.alert-success .ic { color: var(--cyan); }

.alert-error {
  border-color: rgba(255, 108, 132, 0.32);
  background: rgba(255, 92, 120, 0.08);
}

.alert-error .ic { color: #ff9aac; }

.alert-info {
  border-color: rgba(91, 140, 255, 0.3);
  background: rgba(91, 140, 255, 0.08);
}

.alert-info .ic { color: #9dbcff; }

.alert-warning {
  border-color: rgba(255, 196, 107, 0.28);
  background: rgba(255, 196, 107, 0.07);
}

.alert-warning .ic { color: var(--amber); }

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.flash-stack .alert {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Public page additions
   -------------------------------------------------------------------------- */

.how-section {
  background:
    radial-gradient(760px 420px at 20% 0%, rgba(91, 140, 255, 0.08), transparent 65%),
    radial-gradient(600px 380px at 90% 100%, rgba(160, 107, 255, 0.06), transparent 65%);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.how-step {
  position: relative;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.047), rgba(255, 255, 255, 0.014));
  overflow: hidden;
}

.how-step::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(91, 140, 255, 0.15), transparent 70%);
  pointer-events: none;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border: 1px solid rgba(140, 165, 230, 0.25);
  border-radius: 11px;
  background: rgba(91, 140, 255, 0.11);
  color: #b6ccff;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
}

.how-step h3 {
  margin-bottom: 7px;
  font-size: 17px;
}

.how-step p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.how-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px dashed rgba(158, 178, 228, 0.24);
  border-radius: 13px;
  color: var(--muted);
  font-size: 12.5px;
}

.how-note .ic {
  width: 16px;
  height: 16px;
  color: var(--cyan);
  flex: none;
}

.legal-content {
  max-width: 820px;
  margin: 0 auto;
}

.legal-content h2 {
  margin: 34px 0 12px;
  font-size: 22px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.legal-content ul {
  margin-top: 10px;
  padding-left: 20px;
  list-style: disc;
}

.legal-content li + li {
  margin-top: 7px;
}

.legal-content strong {
  color: var(--text);
}

.plans-page-head {
  padding-top: 34px;
}

.section-tight {
  padding-top: 26px;
}

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */

.auth-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-header {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s;
}

.auth-back:hover {
  color: var(--text);
}

.auth-back .ic {
  width: 15px;
  height: 15px;
}

.auth-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px 60px;
  display: grid;
  align-items: center;
}

.auth-shell {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  border: 1px solid rgba(140, 160, 255, 0.22);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(17, 24, 46, 0.96), rgba(8, 12, 24, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-aside {
  position: relative;
  padding: clamp(30px, 4vw, 48px);
  background:
    radial-gradient(520px 380px at 0% 0%, rgba(91, 140, 255, 0.25), transparent 65%),
    radial-gradient(420px 340px at 100% 100%, rgba(160, 107, 255, 0.2), transparent 65%),
    rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.auth-aside .eyebrow {
  margin-bottom: 16px;
}

.auth-aside h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.35rem);
  letter-spacing: -0.035em;
}

.auth-aside > p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.auth-benefits {
  display: grid;
  gap: 13px;
  margin-top: 30px;
}

.auth-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #c6d2eb;
  font-size: 13px;
  line-height: 1.5;
}

.auth-benefits .ic {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--cyan);
  flex: none;
}

.auth-aside-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
}

.auth-aside-foot .ic {
  width: 14px;
  height: 14px;
  color: var(--cyan);
}

.auth-card {
  padding: clamp(28px, 4vw, 48px);
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  letter-spacing: -0.035em;
}

.auth-intro {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.auth-switch {
  margin-top: 22px;
  color: var(--muted-2);
  font-size: 12.5px;
  text-align: center;
}

.auth-switch a {
  color: #a9c2ff;
}

.auth-switch a:hover {
  color: #fff;
}

.auth-small {
  margin-top: 20px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.auth-footer {
  padding: 0 24px 26px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.auth-footer a {
  color: var(--muted);
}

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

  .auth-aside {
    display: none;
  }

  .auth-main {
    max-width: 560px;
    padding-top: 10px;
  }
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label {
  color: #c9d4eb;
  font-size: 12px;
  font-weight: 500;
}

.field .optional {
  color: var(--muted-2);
  font-weight: 400;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid rgba(158, 178, 228, 0.2);
  border-radius: 11px;
  background: rgba(5, 9, 20, 0.55);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(152, 164, 194, 0.55);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(120, 155, 255, 0.7);
  background: rgba(7, 12, 26, 0.8);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12);
}

.input.has-error,
.has-error .input {
  border-color: rgba(255, 108, 132, 0.65);
}

.field-help {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}

.field-error {
  color: #ff9aac;
  font-size: 11.5px;
  line-height: 1.45;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--brand);
}

.check-row a {
  color: #b6ccff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.form-note {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.55;
}

.input-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.input-group .input {
  flex: 1;
}

.input-group .btn {
  flex: none;
}

.fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset + .fieldset {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.fieldset legend {
  margin-bottom: 14px;
  color: var(--text);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
}

.prefix-input {
  position: relative;
}

.prefix-input .prefix {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 14px;
}

.prefix-input .input {
  padding-left: 30px;
}

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

  .form-grid .full {
    grid-column: auto;
  }
}

/* --------------------------------------------------------------------------
   App shell (client + admin)
   -------------------------------------------------------------------------- */

.app-body {
  background: var(--bg);
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(420px 300px at 30% 0%, rgba(91, 140, 255, 0.1), transparent 65%),
    rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-y: auto;
}

.app-sidebar .brand {
  padding: 0 6px;
  margin-bottom: 22px;
}

.sidebar-label {
  padding: 0 9px;
  margin-bottom: 9px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.side-nav a .ic {
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  transition: color 0.2s;
}

.side-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.side-nav a.active {
  border-color: rgba(91, 140, 255, 0.24);
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.14), rgba(160, 107, 255, 0.06));
  color: #f2f5ff;
}

.side-nav a.active .ic {
  color: #a9c2ff;
}

.nav-count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 196, 107, 0.12);
  color: #ffd596;
  font-size: 9.5px;
  font-weight: 600;
}

.sidebar-spacer {
  flex: 1;
  min-height: 22px;
}

.sidebar-help {
  margin-top: 10px;
  padding: 15px;
  border: 1px solid rgba(140, 160, 255, 0.2);
  border-radius: 14px;
  background:
    radial-gradient(240px 160px at 0% 0%, rgba(91, 140, 255, 0.2), transparent 70%),
    rgba(255, 255, 255, 0.025);
}

.sidebar-help .ic {
  width: 18px;
  height: 18px;
  margin-bottom: 9px;
  color: var(--cyan);
}

.sidebar-help strong {
  display: block;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.sidebar-help p {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.55;
}

.sidebar-help a {
  display: inline-block;
  margin-top: 8px;
  color: #a9c2ff;
  font-size: 11px;
  font-weight: 500;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 6px 2px;
  border-top: 1px solid var(--line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--grad);
  color: #050814;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-user-info {
  min-width: 0;
  flex: 1;
}

.sidebar-user-info strong {
  display: block;
  overflow: hidden;
  color: #e8eeff;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-info span {
  display: block;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-form {
  margin: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.icon-btn .ic {
  width: 15px;
  height: 15px;
}

.app-main {
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-context .ic {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.2s;
}

.topbar-link:hover {
  color: var(--text);
}

.topbar-link .ic {
  width: 14px;
  height: 14px;
}

.mobile-logout {
  display: none;
}

.app-content {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 30px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin-top: 2px;
  font-size: clamp(1.55rem, 2.8vw, 2rem);
  letter-spacing: -0.035em;
}

.page-head p {
  max-width: 620px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted-2);
  font-size: 11.5px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text);
}

.back-link .ic {
  width: 13px;
  height: 13px;
}

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

  .app-sidebar {
    position: relative;
    height: auto;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .app-sidebar .brand {
    margin-bottom: 0;
  }

  .sidebar-label,
  .sidebar-help,
  .sidebar-user,
  .sidebar-spacer {
    display: none;
  }

  .side-nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav a {
    flex: none;
    white-space: nowrap;
    padding: 8px 11px;
    border-radius: 9px;
    font-size: 12px;
  }

  .nav-count {
    display: none;
  }

  .app-topbar {
    padding: 0 20px;
  }

  .mobile-logout {
    display: grid;
  }

  .app-content {
    padding: 22px 20px 40px;
  }
}

@media (max-width: 720px) {
  .page-head {
    flex-direction: column;
    gap: 14px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .topbar-context {
    display: none;
  }

  .app-topbar {
    min-height: 56px;
    justify-content: flex-end;
  }

  .app-content {
    padding: 18px 16px 36px;
  }
}

/* --------------------------------------------------------------------------
   Cards, stats, tables
   -------------------------------------------------------------------------- */

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.043), rgba(255, 255, 255, 0.013));
  overflow: hidden;
}

.card + .card {
  margin-top: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.card-head h2,
.card-head h3 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card-head p {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.card-head .ic {
  width: 17px;
  height: 17px;
  color: var(--muted-2);
}

.card-body {
  padding: 20px;
}

.card-body.tight {
  padding: 14px 18px;
}

.card-link {
  color: #a9c2ff;
  font-size: 11.5px;
  font-weight: 500;
  transition: color 0.2s;
}

.card-link:hover {
  color: #fff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012));
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-head span:first-child {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(140, 165, 230, 0.18);
  border-radius: 8px;
  background: rgba(91, 140, 255, 0.1);
  color: #a9c2ff;
}

.stat-icon .ic {
  width: 14px;
  height: 14px;
}

.stat-value {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.stat-meta {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.stat-card.accent {
  border-color: rgba(140, 160, 255, 0.26);
  background:
    radial-gradient(240px 120px at 100% 0%, rgba(160, 107, 255, 0.15), transparent 70%),
    linear-gradient(180deg, rgba(91, 140, 255, 0.1), rgba(255, 255, 255, 0.015));
}

.empty-state {
  padding: 34px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
}

.empty-state .empty-icon .ic {
  width: 21px;
  height: 21px;
}

.empty-state h3 {
  margin-bottom: 5px;
  font-size: 15px;
}

.empty-state p {
  max-width: 380px;
  margin: 0 auto 16px;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.6;
}

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

.notice-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 196, 107, 0.24);
  border-radius: 12px;
  background: rgba(255, 196, 107, 0.06);
  color: #e8d9bd;
  font-size: 12.5px;
  line-height: 1.55;
}

.notice-row .ic {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--amber);
}

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.data th {
  padding: 0 14px 10px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

table.data td {
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  color: #c8d3e9;
  vertical-align: middle;
}

table.data tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

table.data th:first-child,
table.data td:first-child {
  padding-left: 20px;
}

table.data th:last-child,
table.data td:last-child {
  padding-right: 20px;
  text-align: right;
}

table.data .cell-strong {
  display: block;
  color: var(--text);
  font-weight: 500;
}

table.data .cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

table.data .actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.table-empty {
  padding: 28px 20px;
  color: var(--muted-2);
  font-size: 12.5px;
  text-align: center;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
}

.filter-chip {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.filter-chip.active {
  border-color: rgba(91, 140, 255, 0.42);
  background: rgba(91, 140, 255, 0.1);
  color: #d8e4ff;
}

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

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  width: 100%;
}

.search-form .input {
  height: 38px;
  min-height: 38px;
  font-size: 12.5px;
}

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

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s;
}

.list-row:hover {
  border-color: rgba(120, 155, 255, 0.3);
  background: rgba(91, 140, 255, 0.04);
}

.list-row-main {
  min-width: 0;
  flex: 1;
}

.list-row-main strong {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.list-row-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

@media (max-width: 900px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   Service + account + invoice
   -------------------------------------------------------------------------- */

.service-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 1px solid rgba(140, 160, 255, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(500px 260px at 0% 0%, rgba(91, 140, 255, 0.14), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  margin-bottom: 18px;
}

.service-hero h1 {
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
}

.service-hero .service-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.service-hero .service-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.service-hero .service-meta .ic {
  width: 13px;
  height: 13px;
}

.service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}

.kv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.kv {
  min-width: 0;
}

.kv span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kv strong {
  display: block;
  overflow-wrap: anywhere;
  color: #dbe4f7;
  font-size: 12.5px;
  font-weight: 500;
}

.secret-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(5, 9, 20, 0.5);
}

.secret-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #dfe7ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secret-box.blurred code {
  filter: blur(4px);
  user-select: none;
}

.copy-btn {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.copy-btn .ic {
  width: 13px;
  height: 13px;
}

.ns-list {
  display: grid;
  gap: 8px;
}

.ns-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px dashed rgba(158, 178, 228, 0.22);
  border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.ns-row span {
  flex: 1;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.spec {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.spec small {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spec strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
}

.invoice-layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
  align-items: start;
}

.invoice-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.invoice-meta .kv span {
  margin-bottom: 4px;
}

.invoice-meta .kv strong {
  font-size: 13px;
}

.invoice-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.invoice-lines th {
  padding: 13px 20px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.invoice-lines td {
  padding: 15px 20px;
  border-top: 1px solid var(--line);
}

.invoice-lines td:last-child,
.invoice-lines th:last-child {
  text-align: right;
}

.invoice-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
}

.invoice-total span {
  color: var(--muted);
  font-size: 12px;
}

.invoice-total strong {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.receipt {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(158, 178, 228, 0.2);
  font-size: 12px;
}

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.receipt-row span {
  color: var(--muted-2);
}

.receipt-row strong {
  color: #dfe7ff;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.payment-panel {
  position: sticky;
  top: 86px;
  padding: 22px;
  border: 1px solid rgba(140, 160, 255, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(160, 107, 255, 0.13), transparent 65%),
    linear-gradient(180deg, rgba(20, 28, 54, 0.95), rgba(9, 13, 26, 0.98));
  box-shadow: var(--shadow);
}

.payment-panel h2 {
  font-size: 18px;
  margin-bottom: 5px;
}

.payment-panel > p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.payment-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 16px 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.payment-amount small {
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

.qr-shell {
  margin-top: 18px;
  text-align: center;
}

.qr-box {
  display: inline-grid;
  place-items: center;
  width: 232px;
  height: 232px;
  margin: 0 auto;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.8);
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(158, 178, 228, 0.28);
  border-radius: 12px;
  color: var(--muted-2);
  font-size: 11px;
}

.qr-placeholder .ic {
  width: 26px;
  height: 26px;
}

.qr-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  flex-wrap: wrap;
}

.qr-meta code {
  color: #dfe7ff;
  font-size: 11px;
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 196, 107, 0.25);
  border-radius: 999px;
  background: rgba(255, 196, 107, 0.07);
  color: #ffd596;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.payment-status {
  min-height: 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}

.payment-status.error {
  color: #ff9aac;
}

.payment-status.success {
  color: var(--cyan);
}

.payment-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.payment-actions .btn {
  width: 100%;
}

.payment-success-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(55, 230, 201, 0.28);
  border-radius: 12px;
  background: rgba(55, 230, 201, 0.07);
  color: #c9f7ef;
  font-size: 12px;
  line-height: 1.55;
}

.payment-success-box .ic {
  width: 18px;
  height: 18px;
  color: var(--cyan);
  flex: none;
}

.payment-note {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 900px) {
  .invoice-layout {
    grid-template-columns: 1fr;
  }

  .payment-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .kv-list,
  .invoice-meta {
    grid-template-columns: 1fr;
  }

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

  .service-hero {
    flex-direction: column;
  }

  .service-actions {
    width: 100%;
  }

  .service-actions .btn {
    flex: 1;
  }
}

/* --------------------------------------------------------------------------
   Support tickets
   -------------------------------------------------------------------------- */

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

.thread-item {
  display: flex;
  gap: 11px;
}

.thread-item.staff {
  flex-direction: row-reverse;
}

.thread-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
}

.thread-item.staff .thread-avatar {
  border-color: rgba(91, 140, 255, 0.3);
  background: rgba(91, 140, 255, 0.12);
  color: #b6ccff;
}

.thread-content {
  max-width: min(76%, 680px);
}

.thread-item.staff .thread-content {
  text-align: right;
}

.thread-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 10px;
}

.thread-item.staff .thread-head {
  justify-content: flex-end;
}

.thread-head strong {
  color: #cfdaf0;
  font-size: 10.5px;
  font-weight: 600;
}

.thread-bubble {
  display: inline-block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #d5def1;
  font-size: 12.5px;
  line-height: 1.65;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.thread-item.staff .thread-bubble {
  border-color: rgba(91, 140, 255, 0.22);
  border-radius: 12px 4px 12px 12px;
  background: rgba(91, 140, 255, 0.09);
}

.reply-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reply-box textarea {
  min-height: 130px;
}

.ticket-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ticket-info {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.ticket-info span {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ticket-info strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
}

.ticket-subject {
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
}

@media (max-width: 700px) {
  .ticket-info-grid {
    grid-template-columns: 1fr;
  }

  .thread-content {
    max-width: calc(100% - 44px);
  }
}

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */

.admin-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 196, 107, 0.28);
  border-radius: 999px;
  background: rgba(255, 196, 107, 0.08);
  color: #ffd596;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.config-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.config-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.config-flag .ic {
  width: 12px;
  height: 12px;
}

.config-flag.ok {
  border-color: rgba(55, 230, 201, 0.24);
  background: rgba(55, 230, 201, 0.06);
  color: #b9f4e9;
}

.config-flag.warn {
  border-color: rgba(255, 196, 107, 0.24);
  background: rgba(255, 196, 107, 0.06);
  color: #ffd596;
}

.plan-editor {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
  overflow: hidden;
}

.plan-editor + .plan-editor {
  margin-top: 10px;
}

.plan-editor summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.plan-editor summary::-webkit-details-marker {
  display: none;
}

.plan-editor summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.plan-summary-main {
  min-width: 0;
  flex: 1;
}

.plan-summary-main strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}

.plan-summary-main > span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.plan-summary-price {
  color: var(--muted);
  font-family: var(--display);
  font-size: 14px;
  white-space: nowrap;
}

.plan-editor[open] summary {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.plan-editor-body {
  padding: 20px;
}

.admin-plan-create {
  margin-bottom: 18px;
  border: 1px dashed rgba(158, 178, 228, 0.25);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.015);
}

.settings-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}

.settings-section + .settings-section {
  margin-top: 18px;
}

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

.settings-head h2 {
  font-size: 16px;
}

.settings-head p {
  max-width: 560px;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.6;
}

.secret-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.secret-state .ic {
  width: 12px;
  height: 12px;
  color: var(--cyan);
}

.activity {
  display: grid;
  gap: 0;
}

.activity-row {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 16px 0;
}

.activity-row:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: rgba(158, 178, 228, 0.16);
}

.activity-dot {
  width: 13px;
  height: 13px;
  margin-top: 3px;
  flex: none;
  border: 2px solid #0a1020;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.4);
}

.activity-main {
  min-width: 0;
}

.activity-main strong {
  display: block;
  color: #d6e0f2;
  font-size: 11.5px;
  font-weight: 500;
}

.activity-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

@media (max-width: 680px) {
  .settings-head {
    flex-direction: column;
    gap: 10px;
  }
}

/* --------------------------------------------------------------------------
   Print invoice
   -------------------------------------------------------------------------- */

.print-body {
  background: #fff;
  color: #1c2438;
  font-family: var(--font);
  margin: 0;
  padding: 32px;
}

.print-page {
  max-width: 760px;
  margin: 0 auto;
}

.print-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 2px solid #1c2438;
}

.print-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.print-brand .brand-mark {
  width: 34px;
  height: 34px;
}

/** Logo sizing lives in site.css; only the printed mark differs. */
.brand-logo-print {
  height: 34px;
  filter: none;
}

.print-meta {
  text-align: right;
  font-size: 12px;
}

.print-meta h1 {
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 26px;
}

.print-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 28px 0;
}

.print-grid h2 {
  margin-bottom: 6px;
  color: #5b6780;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.print-grid p {
  color: #1c2438;
  font-size: 12px;
  line-height: 1.6;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.print-table th {
  padding: 10px;
  background: #f0f3fa;
  color: #5b6780;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.print-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e3e8f2;
}

.print-table td:last-child,
.print-table th:last-child {
  text-align: right;
}

.print-total {
  margin-left: auto;
  width: 260px;
  margin-top: 14px;
}

.print-total div {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 12px;
}

.print-total .grand {
  margin-top: 5px;
  padding-top: 10px;
  border-top: 2px solid #1c2438;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
}

.print-note {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid #e3e8f2;
  color: #6b778d;
  font-size: 10.5px;
  line-height: 1.6;
}

.print-actions {
  max-width: 760px;
  margin: 0 auto 24px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media print {
  .print-actions { display: none; }
  .print-body { padding: 0; }
  @page { margin: 18mm; }
}

/* --------------------------------------------------------------------------
   404 / error page
   -------------------------------------------------------------------------- */

.error-page {
  min-height: 62vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 20px;
}

.error-code {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.error-page p {
  max-width: 420px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Responsive public plans
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .how-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Utility: loading spinner and raised toast
   -------------------------------------------------------------------------- */

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.toast {
  z-index: 200;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form .btn-block {
  margin-top: 2px;
}

/* Prevent grid/flex children from forcing the mobile shell wider than the viewport. */
.app-sidebar,
.app-main,
.app-topbar,
.app-content {
  min-width: 0;
}

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

  .side-nav {
    max-width: 100%;
  }
}

/* Mobile portal navigation: wrap so no links are hidden off-screen. */
@media (max-width: 980px) {
  .side-nav {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}
