﻿:root {
  --bg: #f6f7fb;
  --bg-2: #efe0df;
  --card: #ffffffd1;
  --line: rgba(11, 18, 32, 0.1);
  --text: #0b1220;
  --subtle: rgba(11, 18, 32, 0.65);
  --primary: #b0121b;
  --primary-2: #7d0a12;
  --accent: #f4b76b;
  --ink: #0b1220;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(135deg, #f6eeee 0%, var(--bg-2) 100%);
  overflow-x: hidden;
}

.ambient {
  display: none;
}

.aurora {
  position: absolute;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  filter: blur(0px);
  transform: translate3d(-20%, -30%, 0);
  background: radial-gradient(circle at 30% 30%, rgba(176, 18, 27, 0.2), transparent 55%);
  opacity: 0.9;
}

.aurora--second {
  width: 55vw;
  height: 55vw;
  right: -20%;
  top: 20%;
  transform: none;
  background: radial-gradient(circle at 40% 40%, rgba(11, 18, 32, 0.1), transparent 55%);
}

.page {
  max-width: 940px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  margin: 28px 0 18px;
  text-align: center;
}

.page-top-left {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 6px 0 2px;
}

.brand {
  letter-spacing: 0.22rem;
  font-size: 0.8rem;
  opacity: 0.85;
  color: var(--primary);
  font-family: "Segoe UI", Arial, sans-serif;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-lockup-centered {
  justify-content: center;
}

.brand-logo {
  width: auto;
  height: 28px;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.brand-logo-sidebar {
  height: 32px;
  margin-bottom: 6px;
}

h1 {
  margin: 8px 0;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.04em;
}

.subtitle {
  color: var(--subtle);
  margin: 0;
}

.card {
  background: linear-gradient(140deg, #fffffff0, var(--card)), linear-gradient(120deg, #f6eeee 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: none;
}

.alerts {
  margin-bottom: 14px;
}

.alert {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(176, 18, 27, 0.35);
  border-radius: 10px;
  background: rgba(176, 18, 27, 0.08);
  color: #7d0a12;
}

.error-summary {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(176, 18, 27, 0.4);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: rgba(176, 18, 27, 0.08);
}

.error-summary h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.error-summary ul {
  margin: 0;
  padding-left: 18px;
}

.error-summary li + li {
  margin-top: 4px;
}

.input-invalid {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(176, 18, 27, 0.12);
}

form[aria-busy="true"] {
  opacity: 0.96;
}

button.is-loading,
input[type="submit"].is-loading {
  opacity: 0.8;
  cursor: progress;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid small {
  display: block;
  margin-top: -2px;
  color: var(--subtle);
}

.plan-options {
  display: grid;
  gap: 8px;
}

.plan-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.plan-option input[type="radio"] {
  width: auto;
  margin-top: 2px;
}

.quick-plan-columns {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-plan-group h4,
.quick-plan-summary h4 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  color: var(--text);
}

.quick-plan-group {
  padding: 14px;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(252, 247, 243, 0.9));
}

.quick-plan-grid {
  display: grid;
  gap: 8px;
}

.quick-plan-card {
  display: block;
  margin: 0;
}

.quick-plan-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quick-plan-card-body {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(11, 18, 32, 0.1);
  border-radius: 16px;
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.quick-plan-card-body small {
  color: var(--subtle);
}

.quick-plan-card:hover .quick-plan-card-body {
  transform: translateY(-1px);
  border-color: rgba(176, 18, 27, 0.25);
  box-shadow: 0 10px 24px rgba(11, 18, 32, 0.06);
}

.quick-plan-card input[type="radio"]:checked + .quick-plan-card-body {
  border-color: rgba(176, 18, 27, 0.65);
  background: linear-gradient(135deg, rgba(176, 18, 27, 0.08), rgba(244, 183, 107, 0.14));
  box-shadow: 0 12px 28px rgba(176, 18, 27, 0.1);
}

.quick-plan-summary {
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 247, 243, 0.94));
}

.quick-summary-row {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.quick-summary-subtotal {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

#quick-plan-recurring-note {
  margin-top: 8px;
  color: var(--subtle);
  display: block;
}

.quick-checkout-result {
  margin-top: 10px;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 247, 243, 0.94));
  display: grid;
  gap: 8px;
}
.workspace-summary {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 252, 0.96));
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}
.payment-flow-form {
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.flow-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.flow-step {
  display: grid;
  gap: 6px;
  padding: 12px 12px 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(247,249,252,0.9));
}

.flow-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.flow-step-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.78);
}

.flow-step.is-current {
  border-color: rgba(176, 18, 27, 0.18);
  background: linear-gradient(180deg, rgba(255,250,246,0.98), rgba(252,245,239,0.96));
  box-shadow: 0 12px 28px rgba(176, 18, 27, 0.08);
}

.flow-step.is-current .flow-step-number {
  background: rgba(176, 18, 27, 0.1);
  color: var(--primary-2);
}

.quick-card-fields {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 252, 0.96));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.quick-card-fields h4 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.quick-card-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#quick-checkout-pix-image {
  width: min(220px, 100%);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}

.payment-method-radios {
  gap: 10px;
}

.payment-method-radios label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(11, 18, 32, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  font-weight: 600;
}

.payment-method-radios label {
  margin: 0;
}

.legal-warning {
  margin-top: 4px;
}

label {
  font-weight: 600;
  margin-top: 6px;
}

input,
select,
button,
.link-btn {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font-size: 1rem;
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

select,
input::file-selector-button {
  color: var(--text);
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button,
.link-btn {
  margin-top: 12px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: none;
}

button {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  box-shadow: none;
  letter-spacing: 0.02em;
  color: #fff;
  border: none;
}

.link-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

button:hover,
.link-btn:hover {
  transform: none;
}

.summary {
  background: linear-gradient(160deg, #fffffff5, #ffffffe6);
  border: 1px dashed rgba(11, 18, 32, 0.24);
  border-radius: 12px;
  padding: 12px;
}

.workspace-card .summary,
.workspace-card .legal-warning {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.refund-rules-box p {
  margin: 0 0 6px;
}

.refund-rules-box p:last-child {
  margin-bottom: 0;
}

.account-meta-compact {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(11, 18, 32, 0.1);
}

.account-meta-compact .meta-muted {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(11, 18, 32, 0.66);
}

.account-meta-details {
  margin-top: 6px;
}

.account-meta-details summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: rgba(11, 18, 32, 0.64);
}

.account-inline-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.plan-change-btn-small {
  width: auto;
  min-width: 96px;
  margin-top: 6px;
  padding: 5px 10px;
  font-size: 0.8rem;
  line-height: 1.2;
}

.inline-text-btn {
  width: auto;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-text-btn:hover {
  transform: none;
  color: var(--primary-2);
}

.firebase-cost-card p {
  margin: 0 0 8px;
}

.firebase-cost-card p:last-of-type {
  margin-bottom: 0;
}

.firebase-cost-card {
  margin-top: 16px;
}

.billing-card {
  margin-top: 16px;
}

.billing-card p {
  margin: 0 0 8px;
}

.billing-card p:last-of-type {
  margin-bottom: 0;
}

.status-bar {
  margin: 10px 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 247, 243, 0.94));
  box-shadow: 0 12px 28px rgba(11, 18, 32, 0.05);
}

.status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

#status-text {
  margin: 6px 0 8px;
  color: var(--subtle);
  font-size: 0.95rem;
}

.status-timing {
  margin: 0 0 8px;
  color: rgba(11, 18, 32, 0.72);
  font-size: 0.88rem;
}

.status-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(239, 228, 223, 0.92);
}

#status-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.35s ease;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.45);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 50;
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, rgba(244, 183, 107, 0.12), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 247, 243, 0.96));
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 28px 60px rgba(11, 18, 32, 0.18);
}

.modal-header {
  display: flex;
  justify-content: flex-end;
  margin: -4px -4px 8px;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(11, 18, 32, 0.12);
  border-radius: 999px;
  background: #fff;
  color: rgba(11, 18, 32, 0.82);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close-btn:hover {
  border-color: rgba(176, 18, 27, 0.28);
  color: var(--primary-2);
}

.modal-card-wide {
  width: min(860px, 100%);
}

.modal-card h3 {
  margin: 0 0 6px;
  color: var(--primary);
}

.modal-card p {
  margin: 0 0 12px;
  color: var(--subtle);
}

.modal-card .inline-group button {
  width: auto;
  min-width: 140px;
}

body.modal-open {
  overflow: hidden;
}

.consistency-list {
  max-height: 46vh;
  overflow: auto;
  border: 1px solid rgba(11, 18, 32, 0.14);
  border-radius: 10px;
  padding: 8px;
  background: #fafafa;
  margin-bottom: 12px;
}

.consistency-list ul {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 6px;
}

.consistency-list li {
  list-style: none;
  font-size: 0.92rem;
  line-height: 1.35;
  border-bottom: 1px solid rgba(11, 18, 32, 0.08);
  padding-bottom: 6px;
}

.consistency-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.file-preview-list {
  margin: 8px 0 4px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.file-preview-list li {
  list-style: none;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
}

.file-preview-list li small {
  color: var(--subtle);
}

.file-preview-list li .meta-muted {
  color: rgba(11, 18, 32, 0.55);
}

.file-preview h3 {
  margin-bottom: 6px;
  color: var(--primary);
  font-family: "Segoe UI", Arial, sans-serif;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.stat-card {
  border: 1px solid rgba(11, 18, 32, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.crew-card {
  cursor: pointer;
  transition: border-color 0.18s ease;
}

.crew-card:hover {
  border-color: rgba(176, 18, 27, 0.45);
  transform: none;
}

.crew-card.is-active {
  border-color: var(--primary);
  box-shadow: none;
}

.inline-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-group label,
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  width: auto;
}

input[type="radio"],
input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap input.password-input-with-toggle {
  padding-right: 92px;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  min-width: 74px;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 0.78rem;
  line-height: 1.2;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: none;
}

.password-toggle-btn:hover {
  transform: translateY(-50%);
}

.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-link {
  width: auto;
  min-width: 130px;
  padding: 8px 12px;
  margin-top: 0;
}

.user-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  font-size: 0.9rem;
}

.page-bottom-actions {
  margin: 18px 0 8px;
  display: flex;
  justify-content: center;
}

.page-bottom-actions form {
  margin: 0;
}

.subtle-link-btn {
  width: auto;
  border: 0;
  background: transparent;
  color: rgba(11, 18, 32, 0.58);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 4px 8px;
  margin: 0;
  cursor: pointer;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.subtle-link-btn:hover {
  color: rgba(11, 18, 32, 0.78);
  transform: none;
}

.subtle-link-btn:focus {
  outline: 2px solid rgba(176, 18, 27, 0.4);
  outline-offset: 2px;
}

.subtle-white-btn {
  width: auto;
  border: 1px solid rgba(11, 18, 32, 0.14);
  background: #fff;
  color: rgba(11, 18, 32, 0.74);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 12px;
  margin: 0;
  box-shadow: none;
}

.subtle-white-btn:hover {
  transform: none;
  background: #fcfcfc;
}

.subtle-white-btn:focus {
  outline: 2px solid rgba(176, 18, 27, 0.4);
  outline-offset: 2px;
}

.account-bottom-actions {
  gap: 12px;
}

.ui-v3-enabled {
  background:
    radial-gradient(circle at top left, rgba(176, 18, 27, 0.12), transparent 32%),
    radial-gradient(circle at right 18%, rgba(244, 183, 107, 0.16), transparent 28%),
    linear-gradient(180deg, #f8f2ed 0%, #f2ebe6 46%, #ece7e2 100%);
}

.page-shell {
  max-width: none;
  width: 100%;
  margin: 0;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  align-items: start;
  padding-left: 12px;
  padding-right: 24px;
}

.shell-sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
  justify-self: start;
  width: min(280px, 100%);
}

.page-shell-admin.is-sidebar-collapsed {
  grid-template-columns: 1fr;
}

.page-shell-admin.is-sidebar-collapsed .shell-sidebar {
  display: none;
}

.shell-sidebar-card {
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 24px;
  padding: 22px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 246, 0.94));
  box-shadow: 0 18px 50px rgba(11, 18, 32, 0.08);
}

.shell-eyebrow,
.shell-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(176, 18, 27, 0.08);
  color: var(--primary-2);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shell-title {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
}

.shell-description {
  margin: 0;
  color: rgba(11, 18, 32, 0.68);
  line-height: 1.5;
}

.shell-nav {
  display: grid;
  gap: 10px;
}

.shell-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(11, 18, 32, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.shell-nav-link:hover,
.shell-nav-link:focus {
  border-color: rgba(176, 18, 27, 0.34);
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}

.shell-nav-link.is-active,
.shell-nav-link[aria-current="page"] {
  border-color: rgba(176, 18, 27, 0.5);
  background: linear-gradient(135deg, rgba(176, 18, 27, 0.12), rgba(244, 183, 107, 0.16));
  color: var(--primary-2);
}

.shell-main {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.shell-main-stack {
  display: grid;
  gap: 14px;
  width: min(1280px, 100%);
}

.ui-v3-enabled .card,
.ui-v3-enabled .ui-v3-enabled .hero-admin {
  margin-top: 0;
  margin-bottom: 0;
  padding: 28px;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 246, 0.9)),
    linear-gradient(120deg, rgba(176, 18, 27, 0.1), rgba(244, 183, 107, 0.1));
  box-shadow: 0 24px 48px rgba(11, 18, 32, 0.07);
}

.ui-v3-enabled .page-top-left {
  margin: 0;
}

.page-shell-single {
  max-width: 1360px;
}

.workspace-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workspace-toolbar-card {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 251, 248, 0.92));
  box-shadow: 0 12px 32px rgba(11, 18, 32, 0.06);
}

.workspace-toolbar-card strong {
  font-size: 1.02rem;
  color: var(--text);
}

.workspace-toolbar-card small {
  color: rgba(11, 18, 32, 0.62);
  font-size: 0.82rem;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(176, 18, 27, 0.08);
  color: var(--primary-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-card {
  overflow: hidden;
}

.workspace-card-accent {
  background:
    radial-gradient(circle at top right, rgba(244, 183, 107, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 249, 244, 0.94));
}

.workspace-split {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.workspace-title {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.dense-subtitle {
  margin: 0;
  color: rgba(11, 18, 32, 0.7);
  line-height: 1.55;
}

.workspace-chip-column {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.workspace-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(176, 18, 27, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary-2);
  font-size: 0.84rem;
  font-weight: 600;
}

.empty-state-panel {
  display: grid;
  gap: 10px;
  align-items: start;
  padding: 24px;
  border: 1px dashed rgba(11, 18, 32, 0.16);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(252, 247, 243, 0.92));
}

.empty-state-panel h3 {
  margin: 0;
  font-size: 1.2rem;
}

.empty-state-panel p {
  margin: 0;
  color: rgba(11, 18, 32, 0.68);
  line-height: 1.55;
}

.page-admin {
  max-width: 1440px;
}

.page-admin-login {
  max-width: 680px;
}

.admin-login-card {
  margin-top: 36px;
}

.admin-login-summary {
  margin-top: 16px;
}

.admin-login-form {
  margin-top: 16px;
}

.hero-admin {
  margin-top: 8px;
  margin-bottom: 10px;
}

.admin-stack {
  display: grid;
  gap: 16px;
}

.admin-section {
  scroll-margin-top: 66px;
}

.ui-v3-enabled .admin-section {
  display: grid;
  gap: 12px;
}

.admin-section > h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 1.35rem;
}

.admin-meta-inline {
  font-size: 0.82rem;
  color: rgba(11, 18, 32, 0.72);
}

.hero-admin-compact {
  padding-top: 18px;
  padding-bottom: 18px;
}

.hero-admin-compact h1 {
  margin-bottom: 0;
}

.hero-admin-compact .hero-actions {
  margin-top: 8px;
}

.page-shell-admin .admin-section {
  padding: 18px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.page-shell-admin .admin-section .form-section-title {
  margin-top: 2px;
  margin-bottom: 2px;
}

.page-shell-admin .admin-section .subtitle {
  margin-top: 0;
  margin-bottom: 0;
}

.page-shell-admin .admin-section .stats {
  margin-top: 0;
}

.page-shell-admin .empty-state-panel {
  padding: 18px;
}

.admin-stats .stat-card span {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-2);
}

.account-profile-grid {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
}

.account-profile-grid .stat-card {
  padding: 10px 12px;
  min-height: 78px;
}

.account-profile-grid .stat-card strong {
  font-size: 0.72rem;
  line-height: 1.2;
  margin-bottom: 4px;
  color: rgba(11, 18, 32, 0.7);
}

.account-profile-grid .account-profile-value {
  font-size: 0.9rem !important;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text) !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.account-balance-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.account-balance-grid .stat-card {
  padding: 10px 12px;
  min-height: 82px;
}

.account-balance-grid .stat-card strong {
  font-size: 0.72rem;
  line-height: 1.2;
  margin-bottom: 4px;
  color: rgba(11, 18, 32, 0.7);
}

.account-balance-grid .account-balance-value {
  font-size: 0.9rem !important;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text) !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-form-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.ui-v3-enabled .admin-form-grid {
  gap: 14px 16px;
}

.admin-form-grid button {
  grid-column: 1 / -1;
}

.admin-form-grid-compact .full-row {
  grid-column: 1 / -1;
}

.admin-details {
  border: 1px dashed rgba(11, 18, 32, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.7);
}

.admin-details summary {
  cursor: pointer;
  font-size: 0.86rem;
  color: rgba(11, 18, 32, 0.74);
}

.admin-details > .form-grid {
  margin-top: 8px;
}

.form-section-title {
  margin: 6px 0 0;
  padding-top: 4px;
  color: rgba(11, 18, 32, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-stack {
  display: grid;
  gap: 6px;
  align-content: start;
}

.field-stack label {
  margin-top: 0;
}

.pending-charge-list {
  display: grid;
  gap: 8px;
}

.pending-charge-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.pending-charge-item a {
  margin-left: auto;
}

.admin-manual-rate-row {
  display: grid;
  gap: 6px;
}

.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.admin-actions-grid form {
  border: 1px solid rgba(11, 18, 32, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.admin-inline-actions {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.ui-v3-enabled .admin-inline-actions,
.ui-v3-enabled .admin-user-actions {
  gap: 8px;
}

.admin-inline-actions form {
  display: grid;
  gap: 6px;
}

.admin-inline-actions form input,
.admin-inline-actions form button {
  margin-top: 0;
}

.plan-actions-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.plan-actions-inline .checkbox-row {
  margin: 0;
}

.admin-btn-small {
  width: auto;
  min-width: 72px;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 0.82rem;
  line-height: 1.2;
  box-shadow: none;
}

.admin-btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.admin-credit-trigger {
  width: auto;
  min-width: 88px;
  margin-top: 0;
  padding: 4px 8px;
  font-size: 0.86rem;
  line-height: 1.2;
  box-shadow: none;
}

.admin-col-muted {
  color: rgba(11, 18, 32, 0.52);
  font-size: 0.82rem;
  font-weight: 500;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.admin-user-actions form {
  margin: 0;
}

.account-discount-preview-btn {
  width: auto;
  min-width: 170px;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 0.84rem;
  line-height: 1.2;
}

.admin-simulator-meta {
  margin-top: 8px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.66);
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(11, 18, 32, 0.12);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(246, 241, 236, 0.86);
  font-weight: 700;
}

.admin-table tbody tr:hover {
  background: rgba(176, 18, 27, 0.03);
}

.admin-table tbody td[colspan] {
  padding: 22px 14px;
  color: rgba(11, 18, 32, 0.62);
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 246, 242, 0.86));
}

.admin-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.admin-table th.sortable::after {
  content: " \2195";
  font-size: 0.78em;
  color: rgba(11, 18, 32, 0.46);
}

.admin-table th.sortable.sorted-asc::after {
  content: " \2191";
  color: rgba(11, 18, 32, 0.72);
}

.admin-table th.sortable.sorted-desc::after {
  content: " \2193";
  color: rgba(11, 18, 32, 0.72);
}

.ui-v3-enabled .admin-users-toolbar {
  padding: 16px 18px;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 246, 242, 0.9));
}

.admin-toolbar-meta {
  margin-top: -4px;
}

.admin-queue-summary {
  margin-top: 4px;
}

.ui-v3-enabled .admin-users-toolbar input,
.ui-v3-enabled .admin-users-toolbar select {
  background: rgba(255, 255, 255, 0.94);
}

.ui-v3-enabled .invoice-number-input {
  min-height: 42px;
  border-radius: 12px;
}

.ui-v3-enabled .table-wrap + .payment-flow-form {
  margin-top: 16px;
}

.ui-v3-enabled .modal-card .payment-flow-form {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .flow-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.discount-code-col {
  min-width: 420px;
  width: 540px;
}

.discount-code-cell {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 400px;
  max-width: 100%;
}

.discount-code-text {
  display: block;
  flex: 1 1 100%;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: middle;
}

.discount-usage-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(11, 18, 32, 0.2);
  background: #fff;
  color: #0b1220;
}

.discount-usage-badge.single {
  border-color: rgba(125, 10, 18, 0.28);
  background: rgba(125, 10, 18, 0.08);
  color: #7d0a12;
}

.discount-usage-badge.multi {
  border-color: rgba(13, 91, 34, 0.28);
  background: rgba(13, 91, 34, 0.08);
  color: #0d5b22;
}

.discount-copy-btn {
  display: none;
  min-width: 76px;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.discount-copy-btn.is-copied {
  border-color: rgba(13, 91, 34, 0.42);
  color: #0d5b22;
}

.discount-code-cell:hover .discount-copy-btn,
.discount-copy-btn:focus-visible {
  display: inline-flex;
}

.discount-code-cell[data-full-code]:hover::after,
.discount-code-cell[data-full-code]:focus-within::after {
  content: attr(data-full-code);
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 6;
  max-width: min(760px, 90vw);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(11, 18, 32, 0.16);
  background: #fff;
  color: #0b1220;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  box-shadow: 0 8px 20px rgba(11, 18, 32, 0.12);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(11, 18, 32, 0.2);
}

.pill-active {
  color: #0d5b22;
  border-color: rgba(13, 91, 34, 0.35);
  background: rgba(13, 91, 34, 0.08);
}

.pill-expired {
  color: #7d0a12;
  border-color: rgba(125, 10, 18, 0.35);
  background: rgba(125, 10, 18, 0.08);
}

.pill-paused {
  color: #6a4a00;
  border-color: rgba(106, 74, 0, 0.35);
  background: rgba(106, 74, 0, 0.08);
}

.admin-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-users-toolbar {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.admin-users-toolbar label {
  margin-top: 0;
  font-size: 0.86rem;
  color: rgba(11, 18, 32, 0.72);
}

.admin-user-fullname {
  font-weight: 600;
}

.admin-user-email {
  font-size: 0.82rem;
  color: rgba(11, 18, 32, 0.72);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-key-hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px dashed rgba(11, 18, 32, 0.3);
  color: rgba(11, 18, 32, 0.55);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: help;
  user-select: none;
}

.audit-key-hover:hover {
  color: rgba(11, 18, 32, 0.8);
  border-color: rgba(11, 18, 32, 0.45);
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 14px;
  }
  .workspace-toolbar {
    grid-template-columns: 1fr;
  }
  .workspace-split {
    flex-direction: column;
  }
  .workspace-chip-column {
    justify-items: start;
  }
  .card {
    padding: 16px;
  }
  .page-shell {
    grid-template-columns: 1fr;
  }
  .shell-sidebar {
    position: static;
  }
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  .admin-actions-grid {
    grid-template-columns: 1fr;
  }
  .account-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-balance-grid {
    grid-template-columns: 1fr;
  }
  .quick-plan-columns {
    grid-template-columns: 1fr;
  }
  .quick-card-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) and (min-width: 641px) {
  .account-balance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ui-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.ui-toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1400;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}

.ui-toast {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.98);
  color: #122033;
  font-size: 0.95rem;
  font-weight: 600;
}

.ui-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ui-toast-success {
  border-color: rgba(21, 128, 61, 0.16);
  background: #f0fdf4;
}

.ui-toast-danger {
  border-color: rgba(159, 18, 57, 0.18);
  background: #fff1f2;
}

.ui-toast-info {
  border-color: rgba(37, 99, 235, 0.16);
  background: #eff6ff;
}

.ui-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1500;
  width: 100%;
  height: 4px;
  transform-origin: left center;
  background: linear-gradient(90deg, #9f1239 0%, #c2410c 48%, #9f1239 100%);
  box-shadow: 0 4px 16px rgba(159, 18, 57, 0.28);
}

.ui-loading-bar.is-active {
  animation: uiLoadingBar 1.2s linear infinite;
}

@keyframes uiLoadingBar {
  0% {
    transform: scaleX(0.14);
    opacity: 0.65;
  }
  50% {
    transform: scaleX(0.58);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0.78;
  }
}

.alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.alert {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.95);
  color: #122033;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.alert-success {
  background: #f0fdf4;
  border-color: rgba(21, 128, 61, 0.16);
}

.alert-danger {
  background: #fff1f2;
  border-color: rgba(159, 18, 57, 0.18);
}

.alert-info {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.16);
}

.alert.is-dimmed {
  opacity: 0.82;
}

.table-empty-row td {
  padding: 22px 18px;
  border-bottom: none;
  background: transparent;
}

.empty-state-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(255, 255, 255, 0.98));
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(159, 18, 57, 0.08);
  color: #9f1239;
  font-size: 1.15rem;
  font-weight: 800;
}

.empty-state-copy {
  display: grid;
  gap: 6px;
}

.empty-state-copy strong {
  color: #122033;
  font-size: 0.98rem;
}

.empty-state-copy p {
  margin: 0;
  color: rgba(18, 32, 51, 0.74);
  font-size: 0.92rem;
  line-height: 1.45;
}

