:root {
  --bg: #f4efe6;
  --surface: rgba(255, 250, 244, 0.82);
  --surface-strong: #fffdf9;
  --surface-deep: #13231f;
  --line: rgba(43, 35, 24, 0.1);
  --line-strong: rgba(43, 35, 24, 0.18);
  --text: #201912;
  --muted: #736556;
  --accent: #c46134;
  --accent-strong: #8f3f1b;
  --accent-soft: rgba(196, 97, 52, 0.12);
  --green: #15735d;
  --green-soft: rgba(21, 115, 93, 0.12);
  --blue: #2554d8;
  --danger: #b23434;
  --success: #15735d;
  --bg-accent: rgba(196, 97, 52, 0.08);
  --shadow: 0 24px 60px rgba(53, 35, 16, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 248px;
  --font-title: 'Manrope', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 186, 112, 0.34), transparent 28%),
    radial-gradient(circle at right 12%, rgba(36, 103, 82, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf7f2 0%, #ece4d7 100%);
  font-family: var(--font-body);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 24px 18px;
  background: rgba(19, 35, 31, 0.92);
  color: #f5ede2;
  backdrop-filter: blur(22px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-title {
  margin: 18px 0 8px;
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.brand-copy {
  margin: 0;
  color: rgba(245, 237, 226, 0.72);
  font-size: 13px;
  line-height: 1.7;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: rgba(245, 237, 226, 0.8);
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff6ea;
  transform: translateX(2px);
}

.sidebar-meta {
  margin-top: 22px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-meta strong,
.sidebar-meta span {
  display: block;
}

.sidebar-meta strong {
  font-size: 12px;
  color: rgba(255, 245, 233, 0.72);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-meta span {
  margin-top: 8px;
  font-size: 18px;
  font-family: var(--font-title);
  font-weight: 700;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 28px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.topbar h1,
.hero-title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.topbar h1 {
  font-size: clamp(28px, 3vw, 42px);
}

.topbar p,
.hero-copy,
.section-copy,
.kv-label,
.table-muted,
.status-banner {
  color: var(--muted);
}

.topbar p {
  margin: 8px 0 0;
  font-size: 14px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 600;
}

.layout-grid {
  margin-top: 20px;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.card,
.login-panel,
.hero-panel {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.card {
  padding: 24px;
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 32px;
  min-height: 300px;
  background:
    linear-gradient(135deg, rgba(196, 97, 52, 0.98), rgba(128, 56, 28, 0.94)),
    var(--surface-strong);
  color: #fff6ec;
}

.public-page-grid {
  display: grid;
  gap: 20px;
}

.public-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
}

.public-page-header-meta {
  display: grid;
  gap: 12px;
}

.public-page-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.public-page-subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.public-page-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.public-page-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 252, 248, 0.92);
  box-shadow: var(--shadow);
}

.billing-plan-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.billing-plan-card {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 26px;
  border-radius: 26px;
  border: 1px solid rgba(86, 76, 117, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 246, 241, 0.88));
  box-shadow: 0 18px 42px rgba(53, 35, 16, 0.08);
}

.billing-plan-card.is-featured {
  background: linear-gradient(180deg, rgba(243, 236, 255, 0.98), rgba(248, 245, 255, 0.92));
  border-color: rgba(148, 123, 232, 0.2);
}

.billing-plan-card.is-active {
  border-color: rgba(196, 97, 52, 0.24);
  box-shadow: 0 20px 48px rgba(196, 97, 52, 0.12);
}

.billing-plan-head h3 {
  margin: 14px 0 0;
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.billing-plan-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  min-height: 50px;
}

.billing-plan-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(32, 25, 18, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.billing-plan-tag.is-featured {
  background: rgba(148, 123, 232, 0.14);
  color: #7254d6;
}

.billing-plan-tag.is-active {
  background: rgba(196, 97, 52, 0.12);
  color: var(--accent-strong);
}

.billing-plan-price {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  color: #2d2f59;
}

.billing-plan-currency {
  padding-bottom: 6px;
  color: #ff7a1a;
  font-size: 18px;
  font-weight: 700;
}

.billing-plan-price strong {
  color: #ff7a1a;
  font-family: var(--font-title);
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.92;
}

.billing-plan-cycle {
  padding-bottom: 7px;
  color: #4b4c74;
  font-size: 18px;
  font-weight: 700;
}

.billing-plan-yearly-note {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #2b7fff;
}

.billing-cycle-toggle {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(86, 76, 117, 0.08);
}

.billing-cycle-option {
  padding: 6px 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #4b4c74;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.billing-cycle-option.is-active {
  background: #fff;
  color: #2f2b52;
  box-shadow: 0 1px 4px rgba(47, 43, 82, 0.12);
}

.billing-cycle-option em {
  font-style: normal;
  color: #2b7fff;
}

.billing-plan-features {
  margin: 0;
  padding: 18px 0 0;
  list-style: none;
  display: grid;
  gap: 12px;
  border-top: 1px dashed rgba(86, 76, 117, 0.18);
}

.billing-plan-features li {
  position: relative;
  padding-left: 28px;
  color: #4b4c74;
  font-size: 14px;
  line-height: 1.7;
}

.billing-plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(98, 101, 255, 0.1);
  color: #6265ff;
  font-size: 12px;
  font-weight: 800;
}

.billing-plan-footer {
  margin-top: auto;
  padding-top: 6px;
}

.billing-plan-button {
  width: 100%;
  justify-content: center;
}

.billing-current-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.billing-current-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.billing-plan-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.public-checkout-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.8fr);
  align-items: start;
}

.public-order-card,
.public-checkout-side {
  padding: 28px;
}

.public-order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.public-order-label,
.public-side-title,
.public-payment-method-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.public-order-top h2 {
  margin: 10px 0 0;
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.public-order-amount {
  min-width: 180px;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(196, 97, 52, 0.12), rgba(196, 97, 52, 0.04));
  border: 1px solid rgba(196, 97, 52, 0.14);
}

.public-order-amount span,
.public-order-item span,
.public-side-total span,
.cashier-order-name {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.public-order-amount strong,
.public-side-total strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-title);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.public-order-grid {
  margin-top: 22px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-order-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.public-order-item strong {
  display: block;
  margin-top: 10px;
  font-size: 18px;
  font-weight: 700;
}

.public-payment-method {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.public-payment-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.public-payment-option.is-active {
  border-color: rgba(196, 97, 52, 0.28);
  box-shadow: inset 0 0 0 1px rgba(196, 97, 52, 0.08);
}

.public-payment-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1f7ae0 0%, #00a0e9 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.public-payment-option strong,
.public-payment-option p,
.cashier-method strong,
.cashier-method span {
  display: block;
}

.public-payment-option p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.public-payment-option span {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(21, 115, 93, 0.1);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.public-rule-box {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(32, 25, 18, 0.04);
  border: 1px solid var(--line);
}

.public-rule-box strong {
  display: block;
  font-size: 15px;
}

.public-rule-box p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.public-checkout-side {
  display: grid;
  gap: 18px;
}

.public-side-section {
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.public-feature-list {
  margin: 14px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--text);
  line-height: 1.7;
}

.public-side-total {
  padding-bottom: 16px;
}

.public-pay-button {
  width: 100%;
  justify-content: center;
}

.public-checkout-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.cashier-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 20, 16, 0.38);
  backdrop-filter: blur(10px);
}

.cashier-modal {
  width: min(620px, 100%);
  padding: 26px;
  border-radius: 28px;
  background: rgba(255, 252, 248, 0.98);
  border: 1px solid rgba(43, 35, 24, 0.12);
  box-shadow: 0 30px 80px rgba(25, 17, 10, 0.24);
}

.cashier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cashier-brand {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.cashier-head h3 {
  margin: 8px 0 0;
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.cashier-close {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(32, 25, 18, 0.04);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 700;
}

.cashier-amount {
  margin-top: 22px;
  font-family: var(--font-title);
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.cashier-order-name {
  margin-top: 8px;
}

.cashier-methods {
  margin-top: 22px;
}

.cashier-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.cashier-method.is-active {
  border-color: rgba(31, 122, 224, 0.22);
  box-shadow: inset 0 0 0 1px rgba(31, 122, 224, 0.08);
}

.cashier-method span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.cashier-method em {
  font-style: normal;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.cashier-qr-shell {
  margin-top: 22px;
  display: grid;
  gap: 18px;
  grid-template-columns: 180px 1fr;
  align-items: center;
}

.cashier-qr-box {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 20px;
  border: 10px solid #ffffff;
  background:
    linear-gradient(90deg, rgba(32, 25, 18, 0.82) 12px, transparent 12px) 0 0 / 36px 36px,
    linear-gradient(rgba(32, 25, 18, 0.82) 12px, transparent 12px) 0 0 / 36px 36px,
    linear-gradient(135deg, rgba(31, 122, 224, 0.14), rgba(0, 160, 233, 0.04)),
    #f9fbff;
  box-shadow: inset 0 0 0 1px rgba(43, 35, 24, 0.08);
}

.cashier-qr-box::before,
.cashier-qr-box::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border: 8px solid #1d1d1d;
  border-radius: 10px;
  background: #ffffff;
}

.cashier-qr-box::before {
  top: 14px;
  left: 14px;
}

.cashier-qr-box::after {
  right: 14px;
  bottom: 14px;
}

.cashier-qr-copy strong,
.cashier-qr-copy span {
  display: block;
}

.cashier-qr-copy strong {
  font-size: 18px;
}

.cashier-qr-copy span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.8;
}

.cashier-footer {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.hero-panel::after {
  content: '';
  position: absolute;
  right: -56px;
  bottom: -56px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.hero-title {
  margin-top: 20px;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 0.92;
}

.hero-copy {
  max-width: 560px;
  margin-top: 14px;
  color: rgba(255, 246, 236, 0.84);
  font-size: 15px;
  line-height: 1.8;
}

.hero-stats {
  margin-top: 28px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-stat {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-stat span,
.hero-stat strong {
  display: block;
}

.hero-stat span {
  font-size: 12px;
  color: rgba(255, 246, 236, 0.78);
}

.hero-stat strong {
  margin-top: 8px;
  font-family: var(--font-title);
  font-size: 22px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(720px, 100%);
  padding: 28px;
  background: rgba(255, 250, 244, 0.92);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.login-brand-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(43, 35, 24, 0.08);
  box-shadow: 0 16px 34px rgba(53, 35, 16, 0.12);
}

.login-panel h2,
.card h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-copy {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.form-grid {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.input,
.code-row input,
.code-row button,
.textarea,
.action-button,
.action-button-secondary,
.action-button-ghost {
  border-radius: 16px;
}

.input,
.textarea,
.code-row input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(43, 35, 24, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.input:focus,
.textarea:focus,
.code-row input:focus {
  outline: none;
  border-color: rgba(196, 97, 52, 0.38);
  box-shadow: 0 0 0 4px rgba(196, 97, 52, 0.08);
  background: #ffffff;
}

.code-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.action-button,
.action-button-secondary,
.action-button-ghost,
.code-row button {
  appearance: none;
  border: none;
  padding: 13px 18px;
  font-weight: 700;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.action-button:hover,
.action-button-secondary:hover,
.action-button-ghost:hover,
.code-row button:hover {
  transform: translateY(-1px);
}

.action-button:disabled,
.action-button-secondary:disabled,
.action-button-ghost:disabled,
.code-row button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.action-button {
  color: #fff8f2;
  background: linear-gradient(135deg, var(--accent) 0%, #b05127 100%);
  box-shadow: 0 16px 36px rgba(196, 97, 52, 0.24);
}

.action-button-secondary,
.code-row button {
  color: var(--accent-strong);
  background: rgba(196, 97, 52, 0.11);
}

.action-button-ghost {
  color: var(--text);
  background: rgba(32, 25, 18, 0.06);
}

.status-banner {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid transparent;
  background: rgba(32, 25, 18, 0.04);
}

.status-banner[data-tone='success'] {
  background: rgba(21, 115, 93, 0.1);
  border-color: rgba(21, 115, 93, 0.14);
  color: #105847;
}

.status-banner[data-tone='error'] {
  background: rgba(178, 52, 52, 0.1);
  border-color: rgba(178, 52, 52, 0.16);
  color: #8c2020;
}

.status-banner[data-tone='info'] {
  background: rgba(37, 84, 216, 0.08);
  border-color: rgba(37, 84, 216, 0.14);
  color: #1f4ac1;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-grid-secondary {
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.kpi-compact strong {
  font-size: 24px;
}

.kpi strong,
.kpi span {
  display: block;
}

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

.kpi strong {
  margin-top: 10px;
  font-family: var(--font-title);
  font-size: 30px;
  letter-spacing: -0.05em;
}

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

.kv {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.kv-label,
.kv-value {
  display: block;
}

.kv-label {
  font-size: 12px;
}

.kv-value {
  margin-top: 8px;
  font-weight: 700;
  line-height: 1.5;
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.code-block {
  margin-top: 16px;
  padding: 16px;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(19, 35, 31, 0.08);
  background: #111a18;
  color: #ecf4f1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.table-shell {
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

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

.table th,
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(43, 35, 24, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.table th {
  position: sticky;
  top: 0;
  background: rgba(249, 245, 238, 0.94);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table tr:last-child td {
  border-bottom: none;
}

.table-muted {
  text-align: center;
}

.trend-period-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.period-chip {
  appearance: none;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.period-chip.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, #b05127 100%);
  color: #fff8f2;
  box-shadow: 0 10px 20px rgba(196, 97, 52, 0.22);
}

.trend-range-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.tokens-line-chart-shell {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.tokens-line-chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  flex-wrap: wrap;
}

.tokens-line-chart-frame {
  padding: 12px 14px 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(244, 235, 225, 0.92));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.tokens-selected-point-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 247, 241, 0.98), rgba(248, 237, 228, 0.94));
  border: 1px solid rgba(196, 97, 52, 0.18);
  box-shadow: 0 10px 24px rgba(53, 35, 16, 0.08);
  margin-top: 16px;
  flex-wrap: wrap;
}

.tokens-selected-point-time {
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-title);
}

.tokens-selected-point-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tokens-selected-point-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(196, 97, 52, 0.14);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tokens-selected-point-chip-strong {
  color: var(--accent-strong);
}

.tokens-line-chart-svg {
  width: 100%;
  height: 320px;
  display: block;
  cursor: ew-resize;
  touch-action: none;
}

.tokens-line-chart-guides line {
  stroke: rgba(115, 101, 86, 0.22);
  stroke-dasharray: 6 6;
}

.tokens-line-chart-area {
  fill: url(#tokenTrendFill);
}

.tokens-line-chart-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 10px 18px rgba(196, 97, 52, 0.18));
}

.tokens-line-chart-point {
  fill: #ffffff;
  stroke: var(--accent);
  stroke-width: 3;
}

.tokens-line-chart-point-group.is-selected .tokens-line-chart-point {
  fill: var(--accent);
  stroke: #ffffff;
  stroke-width: 4;
}

.tokens-line-chart-point-hit {
  fill: transparent;
  cursor: pointer;
}

.tokens-line-chart-tick line {
  stroke: rgba(115, 101, 86, 0.42);
}

.tokens-line-chart-tick text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tokens-line-chart-empty {
  padding: 48px 18px;
  margin-top: 18px;
  border-radius: 20px;
  text-align: center;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(244, 235, 225, 0.92));
  border: 1px solid var(--line);
}

.ops-card {
  overflow: hidden;
}

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

.ops-header h2 {
  margin: 0;
}

.ops-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ops-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ops-period-group {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.ops-period-btn {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-period-btn.is-active {
  background: var(--accent);
  color: #fff6ec;
}

.ops-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.ops-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-weight: 700;
}

.ops-live-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(21, 115, 93, 0.12);
}

.ops-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(178, 52, 52, 0.24);
  background: rgba(178, 52, 52, 0.08);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.ops-loading {
  padding: 48px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.ops-kpi-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

.ops-kpi-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(246, 238, 229, 0.9));
}

.ops-kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-kpi-value {
  font-family: var(--font-title);
  font-size: 26px;
  line-height: 1.1;
}

.ops-kpi-note {
  color: var(--muted);
  font-size: 11px;
}

.ops-delta {
  font-size: 11px;
  font-weight: 700;
}

.ops-delta.is-up { color: var(--green); }
.ops-delta.is-down { color: var(--danger); }
.ops-delta.is-flat { color: var(--muted); }

.ops-total-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 253, 249, 0.6);
}

.ops-total-strip span,
.ops-mini-stats span {
  display: grid;
  gap: 4px;
}

.ops-total-strip small,
.ops-mini-stats small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ops-total-strip strong,
.ops-mini-stats strong {
  font-family: var(--font-title);
  font-size: 18px;
}

.ops-panel-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.ops-panel {
  grid-column: span 4;
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 252, 248, 0.72);
}

.ops-panel-wide {
  grid-column: span 8;
}

.ops-panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.ops-panel h4 {
  margin: 16px 0 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ops-chart-shell {
  display: grid;
  gap: 8px;
}

.ops-chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.ops-chart-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ops-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
}

.ops-chart-legend-item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.ops-chart-frame {
  padding: 8px 10px 4px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(244, 235, 225, 0.92));
  border: 1px solid var(--line);
}

.ops-chart-svg {
  width: 100%;
  height: 260px;
  display: block;
}

.ops-chart-guides line {
  stroke: rgba(115, 101, 86, 0.22);
  stroke-dasharray: 5 6;
}

.ops-chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ops-chart-point {
  stroke: #ffffff;
  stroke-width: 2;
}

.ops-chart-point-hit {
  fill: transparent;
}

.ops-chart-tick line {
  stroke: rgba(115, 101, 86, 0.42);
}

.ops-chart-tick text {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

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

.ops-bar-list {
  display: grid;
  gap: 9px;
}

.ops-bar-row {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) minmax(60px, 1.4fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.ops-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
}

.ops-bar-track,
.ops-funnel-track,
.ops-retention-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(196, 97, 52, 0.12);
  overflow: hidden;
}

.ops-bar-track i,
.ops-funnel-track i,
.ops-retention-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #d99a6e);
}

.ops-bar-value {
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.ops-mini-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(196, 97, 52, 0.06);
}

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

.ops-funnel {
  display: grid;
  gap: 12px;
}

.ops-funnel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.ops-funnel-rate {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.ops-retention-list {
  display: grid;
  gap: 7px;
}

.ops-retention-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px 56px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.ops-retention-row strong {
  text-align: right;
}

.ops-retention-row small {
  text-align: right;
}

.ops-health-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ops-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.ops-health-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ops-health-pill.is-ok i {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(21, 115, 93, 0.12);
}

.ops-health-pill.is-bad {
  border-color: rgba(178, 52, 52, 0.24);
  color: var(--danger);
}

.ops-health-pill.is-bad i {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(178, 52, 52, 0.12);
}

.ops-health-pill small {
  color: var(--muted);
  font-weight: 600;
}

.ops-table-shell {
  margin-top: 6px;
}

.ops-note,
.ops-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.ops-empty {
  padding: 14px 0;
}

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

  .ops-panel,
  .ops-panel-wide {
    grid-column: span 1;
  }

  .ops-split {
    grid-template-columns: 1fr;
  }

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

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

  .ops-controls {
    width: 100%;
  }
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loading-card {
  width: min(460px, 100%);
  padding: 32px;
  text-align: center;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.86);
  box-shadow: var(--shadow);
}

.loading-dot {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--accent), #99471f);
  box-shadow: 0 18px 48px rgba(196, 97, 52, 0.22);
}

.loading-bar {
  margin-top: 18px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 25, 18, 0.08);
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 46%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #e39a73 100%);
  animation: pulse 1.2s ease-in-out infinite;
}

.helper-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.helper-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 246, 236, 0.82);
}

.helper-list li::before {
  content: '•';
  color: #ffe1bf;
}

@keyframes pulse {
  0% { transform: translateX(-10%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(-10%); }
}

@media (max-width: 1180px) {
  .sidebar {
    position: static;
    width: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main {
    margin-left: 0;
  }

  .app-shell {
    flex-direction: column;
  }

  .login-wrap {
    place-items: center;
  }
}

@media (max-width: 900px) {
  .layout-grid,
  .kpi-grid,
  .hero-stats,
  .kv-grid {
    grid-template-columns: 1fr;
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4,
  .span-12 {
    grid-column: span 12;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .card,
  .hero-panel,
  .login-panel {
    padding: 20px;
  }

  .login-brand {
    align-items: flex-start;
  }

  .login-brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .tokens-selected-point-time {
    font-size: 22px;
  }

  .tokens-line-chart-svg {
    height: 260px;
  }

  .public-page-header,
  .public-order-top,
  .cashier-head,
  .cashier-qr-shell {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .public-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .public-checkout-layout,
  .public-order-grid,
  .billing-plan-grid {
    grid-template-columns: 1fr;
  }

  .cashier-qr-box {
    width: 160px;
    height: 160px;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.8; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.captcha-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(43, 35, 24, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.captcha-panel[hidden] {
  display: none;
}

.captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.captcha-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.captcha-link:disabled {
  opacity: 0.5;
  cursor: default;
}

.captcha-stage {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 320 / 180;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(43, 35, 24, 0.06);
}

.captcha-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.captcha-piece {
  position: absolute;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.captcha-slider {
  width: 100%;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

.captcha-slider:disabled {
  opacity: 0.6;
  cursor: default;
}

.captcha-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
