﻿@font-face {
  font-family: 'ProjectFont';
  src: url('../font/font.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ProjectFont';
  src: url('../font/font-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ProjectFontEn';
  src: url('../font/font-en.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ProjectFontEn';
  src: url('../font/font-bold-en.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #06080d;
  --bg-elevated: #0c1018;
  --surface: rgba(18, 24, 38, 0.72);
  --surface-solid: #121826;
  --surface2: rgba(28, 36, 54, 0.85);
  --surface2-solid: #1c2436;
  --surface-hover: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --muted: #94a3b8;
  --primary-rgb: 99, 102, 241;
  --primary: rgb(var(--primary-rgb));
  --primary-hover: #818cf8;
  --accent-secondary: #a855f7;
  --accent-cyan: #22d3ee;
  --success-rgb: 52, 211, 153;
  --success: rgb(var(--success-rgb));
  --warning-rgb: 251, 191, 36;
  --warning: rgb(var(--warning-rgb));
  --danger-rgb: 248, 113, 113;
  --danger: rgb(var(--danger-rgb));
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.44);
  --shadow-glow: 0 0 0 1px rgba(var(--primary-rgb), 0.18), 0 12px 40px rgba(var(--primary-rgb), 0.12);
  --glass: rgba(12, 16, 24, 0.78);
  --glass-border: rgba(255, 255, 255, 0.1);
  --chrome-blur: 14px;
  --chrome-saturate: 1.85;
  --chrome-bg: rgba(8, 11, 18, 0.48);
  --chrome-bg-solid: rgba(8, 11, 18, 0.88);
  --chrome-border: rgba(255, 255, 255, 0.09);
  --chrome-highlight: rgba(255, 255, 255, 0.05);
  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 52%, #60a5fa 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
  --font: 'ProjectFont', system-ui, sans-serif;
  --font-en: 'ProjectFontEn', ui-monospace, monospace;
  --content-width: 480px;
  --nav-height: 76px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --scrollbar-size: 6px;
  --scrollbar-thumb: rgba(148, 163, 184, 0.28);
  --scrollbar-thumb-hover: rgba(148, 163, 184, 0.46);
  --scrollbar-thumb-active: rgba(var(--primary-rgb), 0.55);
  --control-focus-border: rgba(var(--primary-rgb), 0.55);
  --control-focus-ring: rgba(var(--primary-rgb), 0.18);
  --chip-active-border: rgba(var(--primary-rgb), 0.5);
  --chip-active-glow: rgba(var(--primary-rgb), 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  scrollbar-gutter: stable;
}

html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(var(--primary-rgb), 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
    var(--bg);
}

a {
  color: var(--primary-hover);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #c7d2fe;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 16px;
}

.container-wide {
  max-width: 960px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 16px;
  border-bottom: 1px solid var(--chrome-border);
  background: var(--chrome-bg-solid);
  isolation: isolate;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .header {
    background: linear-gradient(
      180deg,
      rgba(8, 11, 18, 0.62) 0%,
      rgba(8, 11, 18, 0.42) 100%
    );
    -webkit-backdrop-filter: blur(var(--chrome-blur)) saturate(var(--chrome-saturate));
    backdrop-filter: blur(var(--chrome-blur)) saturate(var(--chrome-saturate));
  }
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--chrome-highlight) 0%, transparent 42%);
}

.header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
}

@media (display-mode: standalone) {
  .header {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }

  .site-notice {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.header-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-mobile {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 6px 10px;
  background: var(--surface2-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}

.site-notice {
  position: relative;
  z-index: 99;
  background: rgba(var(--primary-rgb), 0.14);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.22);
  color: var(--text);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-notice {
    background: rgba(var(--primary-rgb), 0.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    backdrop-filter: blur(20px) saturate(1.5);
  }
}

.site-notice-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 10px 16px;
  font-size: 0.88rem;
  line-height: 1.7;
  text-align: center;
}

.container-wide ~ .site-notice-inner,
.site-notice .site-notice-inner {
  max-width: 960px;
}

.admin-impersonate-notice {
  background: rgba(var(--warning-rgb), 0.14);
  border-bottom-color: rgba(var(--warning-rgb), 0.28);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .admin-impersonate-notice {
    background: rgba(var(--warning-rgb), 0.1);
  }
}

.admin-impersonate-notice-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
}

.admin-impersonate-return-form {
  margin: 0;
}

.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--transition), background var(--transition);
}

.settings-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface2-solid);
}

.form-group label.settings-toggle {
  display: flex;
  margin-bottom: 0;
  color: var(--text);
  font-size: 1rem;
}

.settings-toggle-info {
  flex: 1;
  min-width: 0;
}

.settings-toggle-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.settings-toggle-desc {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.settings-toggle-control {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
}

.settings-toggle-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.settings-toggle-track {
  display: block;
  width: 48px;
  height: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  pointer-events: none;
  transition: background 0.2s, border-color 0.2s;
}

.settings-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.settings-toggle-control input:checked + .settings-toggle-track {
  background: rgba(var(--success-rgb), 0.22);
  border-color: rgba(var(--success-rgb), 0.55);
}

.settings-toggle-control input:checked + .settings-toggle-track::after {
  transform: translateX(-22px);
  background: var(--success);
}

.settings-toggle-control input:focus-visible + .settings-toggle-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--text);
}

.logo-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-hover);
  background: linear-gradient(135deg, #1c2335 0%, #0f1320 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--gradient-surface);
  pointer-events: none;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -0.01em;
}


.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface2-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus,
.form-control:focus-visible {
  outline: none;
  border-color: var(--control-focus-border);
  box-shadow: 0 0 0 3px var(--control-focus-ring);
  background: var(--surface2-solid);
}

.form-control::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface2-solid);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 40px;
}

select.form-control option,
select.form-control optgroup {
  background: var(--surface-solid);
  color: var(--text);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

.amount-input {
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mobile-input {
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mobile-input::placeholder {
  direction: ltr;
  text-align: right;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), opacity var(--transition);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(var(--primary-rgb), 0.45);
  filter: brightness(1.06);
  text-decoration: none;
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #fff;
  box-shadow: 0 4px 16px rgba(var(--success-rgb), 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: #fff;
  box-shadow: 0 4px 16px rgba(var(--danger-rgb), 0.28);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--text);
  text-decoration: none;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.form-control-sm {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.admin-review-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.admin-review-item:last-child {
  border-bottom: none;
}

.admin-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-review-head .badge {
  flex-shrink: 0;
  margin-top: 2px;
}

.admin-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  align-items: start;
}

.admin-review-approve-form {
  margin: 0;
  grid-column: 1;
  grid-row: 1;
}

.admin-review-amount-label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.admin-review-amount-input {
  margin-bottom: 8px;
  text-align: center;
}


.list-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.list-note--reject {
  background: rgba(var(--danger-rgb), 0.08);
  border: 1px solid rgba(var(--danger-rgb), 0.18);
}

.list-note--info {
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
}

.list-note-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  margin-top: 1px;
}

.list-note--reject .list-note-icon {
  background: rgba(var(--danger-rgb), 0.15);
  color: var(--danger);
}

.list-note--info .list-note-icon {
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary);
}

.list-note-body {
  flex: 1;
  min-width: 0;
}

.list-note-text {
  display: block;
  color: var(--text-muted);
  word-break: break-word;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-success { background: rgba(var(--success-rgb), 0.14); color: var(--success); border-color: rgba(var(--success-rgb), 0.25); }
.badge-warning { background: rgba(var(--warning-rgb), 0.14); color: var(--warning); border-color: rgba(var(--warning-rgb), 0.25); }
.badge-danger { background: rgba(var(--danger-rgb), 0.14); color: var(--danger); border-color: rgba(var(--danger-rgb), 0.25); }
.badge-muted { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); border-color: rgba(148, 163, 184, 0.2); }

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  backdrop-filter: blur(8px);
}

.alert-success { background: rgba(var(--success-rgb), 0.1); border: 1px solid rgba(var(--success-rgb), 0.28); color: var(--success); }
.alert-error { background: rgba(var(--danger-rgb), 0.1); border: 1px solid rgba(var(--danger-rgb), 0.28); color: var(--danger); }
.alert-info { background: rgba(var(--primary-rgb), 0.1); border: 1px solid rgba(var(--primary-rgb), 0.28); color: var(--primary-hover); }
.alert-warning { background: rgba(var(--warning-rgb), 0.1); border: 1px solid rgba(var(--warning-rgb), 0.32); color: var(--warning); }

.flash-alert {
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.35s ease, margin 0.35s ease, padding 0.35s ease, border-width 0.35s ease;
  overflow: hidden;
}

.flash-alert--hide {
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
}

.buy-credit-alert {
  margin-bottom: 12px;
  text-align: center;
}

.buy-credit-alert strong {
  display: block;
  font-size: 0.95rem;
}


.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background var(--transition);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-info {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}

.list-item-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}

.list-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.list-menu {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-inline-end: 6px;
}

.list-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface2-solid);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.list-menu-toggle:hover,
.list-menu.is-open .list-menu-toggle {
  color: var(--primary-hover);
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.4);
}

.list-menu-dropdown {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 4px);
  z-index: 140;
  min-width: 200px;
  max-height: min(320px, calc(100dvh - 16px));
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-lg);
}

.list-menu-dropdown[hidden] {
  display: none;
}

.list-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.84rem;
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.list-menu-item:hover {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-hover);
  text-decoration: none;
}

.list-menu-item .icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.list-menu-item--danger {
  color: var(--danger);
}

.list-menu-item--danger:hover {
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}

.trans-item-head {
  display: flex;
  align-items: center;
}

/* Ù¾Ù†Ù„ Ø³ÙØ§Ø±Ø´â€ŒÙ‡Ø§ÛŒ Ù…Ø´ØªØ±ÛŒ Ø¯Ø± ØµÙØ­Ù‡Ù” Ú†Øª ØªÛŒÚ©Øª Ø§Ø¯Ù…ÛŒÙ† */
.ticket-orders {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2-solid);
}

.ticket-orders-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
  user-select: none;
}

.ticket-orders-summary::-webkit-details-marker {
  display: none;
}

.ticket-orders-summary .icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.ticket-orders[open] .ticket-orders-summary {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.ticket-orders-body {
  padding: 4px 12px;
  max-height: min(220px, 32dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ticket-orders-empty {
  padding: 12px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.ticket-order-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.ticket-order-row > .list-menu {
  flex-shrink: 0;
  margin-top: 1px;
}

.ticket-order-info {
  flex: 1;
  min-width: 0;
}

.ticket-order-row:last-child {
  border-bottom: none;
}

.ticket-order-title {
  font-size: 0.86rem;
  font-weight: 600;
}

.ticket-order-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.trans-item {
  align-items: flex-start;
  gap: 12px;
}

.trans-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.trans-item-aside {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 38%;
}

.trans-item-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
}

.human-time {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
  text-align: inherit;
}

a .human-time[data-human-time-inert] {
  pointer-events: none;
  cursor: inherit;
}

.human-time:hover,
.human-time:focus-visible {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  outline: none;
}

.human-time-tip {
  position: fixed;
  z-index: 220;
  max-width: min(92vw, 280px);
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

.ticket-message-time.human-time {
  font-size: inherit;
}

.trans-item-balance {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.trans-item-meta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  direction: ltr;
  text-align: right;
  width: 100%;
}

.trans-item-note {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
  width: 100%;
}

.trans-item-main .badge {
  flex-shrink: 0;
}


.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0.55;
  color: var(--text-muted);
  width: 56px;
  height: 56px;
  margin-inline: auto;
  align-items: center;
  justify-content: center;
  background: var(--surface2-solid);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.page-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -14px;
  margin-bottom: 20px;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form .form-group {
  flex: 1;
  min-width: 120px;
  margin-bottom: 0;
}

.user-restrictions-form {
  padding: 12px;
  margin-top: -8px;
  margin-bottom: 12px;
  background: var(--surface2);
}

.user-credit-form {
  padding: 12px;
  margin-top: -8px;
  margin-bottom: 12px;
  background: var(--surface2);
  --credit-form-control-h: 42px;
}

.user-credit-form .inline-form {
  align-items: flex-end;
  gap: 10px;
}

.user-credit-form .form-group label,
.user-credit-form .credit-form-label-placeholder {
  margin-bottom: 6px;
  font-size: 0.78rem;
  line-height: 1.2;
}

.user-credit-form .credit-form-label-placeholder {
  visibility: hidden;
  user-select: none;
}

.user-credit-form .form-control,
.user-credit-form .credit-op-toggle,
.user-credit-form .credit-form-action {
  height: var(--credit-form-control-h);
  box-sizing: border-box;
}

.user-credit-form .form-control {
  padding: 0 14px;
  font-size: 0.9rem;
  line-height: 1;
}

.credit-op-group {
  flex: 0 0 auto;
  min-width: 176px;
}

.credit-op-toggle {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.credit-op-option {
  flex: 1;
  margin: 0;
  min-width: 0;
  cursor: pointer;
  display: flex;
  height: 100%;
}

.credit-op-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.credit-op-option .credit-op-btn {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 12px;
  pointer-events: none;
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--surface-solid);
  font-size: 0.85rem;
  line-height: 1;
}

.user-credit-form .credit-submit-group {
  flex: 0 0 auto;
  min-width: 72px;
}

.user-credit-form .credit-form-action {
  width: 100%;
  padding: 0 18px;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
}

.credit-op-option:hover .credit-op-btn {
  border-color: var(--border-strong);
  background: var(--surface2-solid);
  color: var(--text);
}

.credit-op-option--add input:checked + .credit-op-btn {
  border-color: rgba(var(--success-rgb), 0.55);
  background: rgba(var(--success-rgb), 0.14);
  color: var(--success);
  box-shadow: 0 0 0 1px rgba(var(--success-rgb), 0.18);
}

.credit-op-option--deduct input:checked + .credit-op-btn {
  border-color: rgba(var(--danger-rgb), 0.55);
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
  box-shadow: 0 0 0 1px rgba(var(--danger-rgb), 0.16);
}

.credit-op-option input:focus-visible + .credit-op-btn {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  #users-list .list-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #users-list .list-item-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    line-height: 1.45;
  }

  #users-list .list-item-sub {
    word-break: normal;
    overflow-wrap: anywhere;
  }

  #users-list .btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  #users-list .btn-group .inline-form {
    display: block;
    min-width: 0;
    grid-column: 1 / -1;
  }

  #users-list .btn-group .btn {
    width: 100%;
    padding-inline: 8px;
    white-space: nowrap;
  }
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-row:last-of-type {
  margin-bottom: 0;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.marzban-inbound-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.marzban-inbound-group {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface2);
  border: 1px solid var(--border);
}

.marzban-inbound-protocol {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.marzban-inbound-group .checkbox-row {
  margin-bottom: 8px;
}

.marzban-inbound-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.marzban-inbound-row:last-child {
  margin-bottom: 0;
}

.marzban-inbound-check {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}

.marzban-inbound-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marzban-inbound-proto {
  width: auto;
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.marzban-group-row {
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.marzban-group-row:last-child {
  margin-bottom: 0;
}

.marzban-group-row.is-disabled {
  opacity: 0.55;
}

.marzban-group-name {
  font-weight: 600;
  flex-shrink: 0;
}

.marzban-group-inbounds {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marzban-group-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  flex-shrink: 0;
}

.marzban-sub-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.marzban-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.marzban-sub-item-index {
  flex-shrink: 0;
  color: var(--text-muted);
  min-width: 22px;
}

.marzban-sub-item-link {
  direction: ltr;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.marzban-plan-purge-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  overflow: hidden;
}

.marzban-plan-purge-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary, #818cf8);
  transition: width 0.2s ease;
}

.plan-catalog-item--disabled {
  opacity: 0.82;
}

.plan-catalog-item--disabled .list-item-title {
  color: var(--text-muted);
  font-weight: 600;
}

.plan-catalog-item--disabled .list-item-sub {
  opacity: 0.92;
}

.plan-catalog-item--disabled .plan-catalog-status {
  font-size: 0.72rem;
  padding: 2px 7px;
  vertical-align: middle;
}

@media (min-width: 640px) {
  .container {
    padding: 24px;
  }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card .card {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.4);
}

.alt-login-lead {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.alt-copy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.alt-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2-solid);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.alt-copy:hover {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: var(--surface2);
}

.alt-copy:active {
  transform: scale(0.99);
}

.alt-copy-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.alt-copy-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.alt-copy-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  word-break: break-all;
}

.alt-copy-done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(var(--success-rgb), 0.92);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.alt-copy.copied .alt-copy-done {
  opacity: 1;
}

.login-logo h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 6px;
}

.hidden {
  display: none !important;
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.icon {
  display: block;
  flex-shrink: 0;
  width: 1.25em;
  height: 1.25em;
}

.icon--xs { width: 14px; height: 14px; }
.icon--sm { width: 18px; height: 18px; }
.icon--md { width: 24px; height: 24px; }
.icon--lg { width: 32px; height: 32px; }
.icon--xl { width: 40px; height: 40px; }

.card-title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-with-icon > span {
  min-width: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 10px;
}

.font-en {
  font-family: var(--font-en);
  direction: rtl;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-3 { margin-bottom: 16px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding: 10px 0;
}

.pagination-btn {
  border-radius: var(--radius-sm);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 64px;
  text-align: center;
}

.pagination-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.list-container.list-loading {
  position: relative;
  min-height: 140px;
  pointer-events: none;
}

.list-container.list-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(6, 8, 13, 0.35);
  border-radius: inherit;
}

.list-container.list-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid rgba(var(--primary-rgb), 0.18);
  border-top-color: var(--primary-hover);
  border-radius: 50%;
  animation: page-loader-spin 0.7s linear infinite;
}

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  background: rgba(6, 8, 13, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

html.page-is-loading .page-loader,
.page-loader.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html.page-is-loading body {
  overflow: hidden;
}

.page-loader-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  overflow: hidden;
  background: rgba(var(--primary-rgb), 0.12);
}

.page-loader-progress::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--gradient-brand);
  animation: page-loader-indeterminate 1s ease-in-out infinite;
}

.page-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(var(--primary-rgb), 0.18);
  border-top-color: var(--primary-hover);
  border-radius: 50%;
  animation: page-loader-spin 0.7s linear infinite;
}

@keyframes page-loader-spin {
  to { transform: rotate(360deg); }
}

@keyframes page-loader-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.list-search-wrap {
  margin-bottom: 14px;
}

.list-search-wrap .form-control {
  padding: 11px 14px;
}

/* Bottom nav */
.has-bottom-nav {
  padding-bottom: calc(var(--nav-height) + 12px);
}

.has-bottom-nav .header-inner {
  max-width: var(--content-width);
}

.bottom-nav {
  position: fixed;
  bottom: 10px;
  left: 10px;
  right: 10px;
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-lg);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: var(--shadow-lg);
  background: var(--chrome-bg-solid);
  isolation: isolate;
  overflow: hidden;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .bottom-nav {
    background: linear-gradient(
      0deg,
      rgba(8, 11, 18, 0.62) 0%,
      rgba(8, 11, 18, 0.42) 100%
    );
    -webkit-backdrop-filter: blur(var(--chrome-blur)) saturate(var(--chrome-saturate));
    backdrop-filter: blur(var(--chrome-blur)) saturate(var(--chrome-saturate));
  }
}

.bottom-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(0deg, transparent 0%, var(--chrome-highlight) 100%);
}

.bottom-nav::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
}

.bottom-nav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-around;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 14px;
  transition: color var(--transition), background var(--transition), transform var(--transition);
  flex: 1;
  min-width: 0;
}

.bottom-nav a:hover {
  color: var(--text);
  background: var(--surface-hover);
  text-decoration: none;
}

.bottom-nav a.active {
  color: var(--primary-hover);
  background: rgba(var(--primary-rgb), 0.14);
}

.bottom-nav a.active .nav-icon {
  transform: translateY(-1px);
}

.bottom-nav .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

/* Wallet card */
.wallet-card {
  background: var(--gradient-brand);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  margin-top: 16px;
  box-shadow: 0 12px 40px rgba(var(--primary-rgb), 0.35);
  position: relative;
  overflow: hidden;
}

.wallet-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.wallet-card .wallet-label {
  font-size: 0.85rem;
  opacity: 0.88;
}

.wallet-card .wallet-amount {
  font-size: 1.85rem;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.wallet-card .wallet-mobile {
  font-size: 0.85rem;
  opacity: 0.78;
  margin-top: 8px;
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.action-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb), 0.08) 0%, transparent 65%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.action-card:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
  color: var(--text);
}

.action-card:hover::before {
  opacity: 1;
}

.action-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  width: 48px;
  height: 48px;
  margin-inline: auto;
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 14px;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
}

.action-card-icon svg {
  stroke-width: 1.85;
}

.action-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.action-card-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.action-card-wallet {
  font-size: 0.92rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 8px;
  line-height: 1.3;
}

.action-card-disabled .action-card-icon svg {
  opacity: 0.45;
}

.action-card-badge {
  margin-top: 8px;
  line-height: 1.3;
}

.action-card-badge .action-card-sub {
  display: block;
  margin-top: 0;
}

.action-card-charge.action-card-disabled .action-card-wallet {
  opacity: 0.85;
}

.action-card-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.action-card-disabled .action-card-sub {
  color: var(--warning);
}

/* Guide / tutorials */
.guide-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.guide-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
}

.guide-tab:hover {
  text-decoration: none;
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.guide-tab.active {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--text);
  box-shadow: var(--shadow-glow);
}

.guide-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.brand-icon {
  display: block;
  flex-shrink: 0;
}

.guide-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.guide-video iframe,
.guide-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #000;
}

.tutorial-current-video {
  margin-bottom: 8px;
}

.admin-video-preview {
  margin-bottom: 12px;
}

.admin-video-preview-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.admin-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.admin-video-grid-item .guide-video {
  max-width: 100%;
}

.tutorial-live-preview:not(:empty) {
  margin-bottom: 12px;
}

.tutorial-live-preview .admin-video-preview-label {
  color: var(--primary);
}

.tutorial-add-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 200px) 120px;
  gap: 12px;
  align-items: end;
}

.tutorial-add-fields .form-group {
  margin-bottom: 0;
}

.tutorial-section-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 12px;
  align-items: end;
}

.tutorial-section-meta-row .form-group {
  margin-bottom: 0;
}

.tutorial-icon-select {
  position: relative;
  z-index: 1;
}

.tutorial-icon-select.open {
  z-index: 120;
}

.tutorial-section-card:has(.tutorial-icon-select.open),
.card:has(.tutorial-icon-select.open) {
  z-index: 110;
}

.tutorial-icon-select-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.tutorial-icon-select-toggle:hover,
.tutorial-icon-select.open .tutorial-icon-select-toggle {
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.tutorial-icon-select-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  text-align: right;
}

.tutorial-icon-select-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  font-size: 0;
  color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}

.tutorial-icon-select.open .tutorial-icon-select-arrow {
  transform: rotate(180deg);
}

.tutorial-icon-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 6px;
  isolation: isolate;
}

.tutorial-icon-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-solid);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: right;
  transition: background 0.15s;
}

.tutorial-icon-select-option:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tutorial-icon-select-option.selected {
  background: rgba(var(--primary-rgb), 0.08);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.28);
  color: var(--primary-hover);
}

.tutorial-icon-picker-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.tutorial-icon-picker-label {
  font-size: inherit;
  line-height: 1.4;
}

.tutorial-add-action label {
  visibility: hidden;
}

.tutorial-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tutorial-section-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tutorial-section-head-main .card-title {
  min-width: 0;
}

.tutorial-section-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .tutorial-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .tutorial-section-head-actions {
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .tutorial-add-fields,
  .tutorial-section-meta-row {
    grid-template-columns: 1fr;
  }

  .tutorial-add-action label {
    display: none;
  }
}

.form-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.form-check-inline input {
  width: auto;
  margin: 0;
}

/* Sub link box */
.sub-box,
.sub-link {
  font-family: var(--font-en);
}

.sub-box {
  display: block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.8rem;
  word-break: break-all;
  direction: ltr;
  text-align: left;
  margin-top: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s;
}

a.sub-box:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.btn-copy {
  margin-top: 8px;
}

.btn-copy.copied {
  background: var(--success) !important;
}

.order-card {
  margin-bottom: 12px;
}

.order-card:last-child {
  margin-bottom: 0;
}

.order-card-head {
  border: none;
  padding: 0 0 12px;
  align-items: flex-start;
}

.order-card-head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.order-renew-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.order-renew-actions .btn,
.order-renew-actions .renew-sub-check,
.order-renew-actions > .is-disabled {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  justify-content: center;
}

.order-renew-actions .is-disabled {
  opacity: 0.5;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}

.order-sub-info-panel {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface2-solid);
  border: 1px solid var(--border);
}

.order-sub-info-panel.is-loading {
  opacity: 0.85;
}

.order-sub-info-loading,
.order-sub-info-error {
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
}

.order-sub-info-error {
  color: var(--danger);
}

.order-sub-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.order-sub-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.order-sub-info-row:first-child {
  padding-top: 0;
}

.order-sub-info-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.order-sub-info-value {
  font-weight: 600;
  text-align: left;
  direction: ltr;
}

.order-sub-info-value--expire {
  direction: rtl;
  text-align: left;
  unicode-bidi: isolate;
}

.order-sub-info-value--days {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.35em;
  direction: ltr;
  unicode-bidi: isolate;
}

.order-sub-info-value--days .order-sub-info-unit {
  direction: rtl;
  unicode-bidi: isolate;
}

.order-sub-info-value--days .order-sub-info-num {
  direction: ltr;
  unicode-bidi: isolate;
}

.order-qr-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2-solid);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
}

.order-qr-btn:hover {
  border-color: rgba(var(--primary-rgb), 0.45);
  color: var(--primary-hover);
  background: rgba(var(--primary-rgb), 0.08);
  box-shadow: var(--shadow-glow);
}

.order-qr-btn-icon {
  width: 22px;
  height: 22px;
}

.order-renewals-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  overflow: hidden;
}

.order-renewals-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-renewals-details > summary::-webkit-details-marker {
  display: none;
}

.order-renewals-summary-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.order-renewals-summary-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.order-renewals-list {
  border-top: 1px solid var(--border);
  padding: 8px 12px 12px;
}

.order-renewal-item + .order-renewal-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.order-renewal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-renewal-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.order-renewal-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.order-renewal-item .list-note {
  margin-top: 8px;
}

.admin-order-item + .admin-order-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.admin-order-item > .list-item {
  border-bottom: none;
  padding-bottom: 8px;
}

.admin-order-item .order-renewals-details {
  margin-top: 0;
}

.bank-deposit-raw {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.bank-deposit-actions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bank-deposit-candidates-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.bank-deposit-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  margin-bottom: 6px;
}

.bank-deposit-candidate-info {
  font-size: 0.85rem;
}

.admin-order-actions {
  margin-top: 10px;
}

.admin-order-actions-btns {
  flex-wrap: wrap;
}

.admin-order-actions-btns .order-cancel-form,
.admin-order-actions-btns .order-revoke-sub-form {
  display: inline-flex;
  margin: 0;
  gap: 0;
}

.admin-order-actions .order-cancel-msg,
.admin-order-actions .order-revoke-sub-msg {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.admin-order-actions .order-cancel-msg:empty,
.admin-order-actions .order-revoke-sub-msg:empty {
  display: none;
  margin-top: 0;
}

.order-sub-edit-display {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--primary-hover, var(--primary, #60a5fa));
  transition: color 0.15s ease;
}

.order-sub-edit-display:hover {
  color: var(--primary, #3b82f6);
  text-decoration: underline;
}

.order-sub-edit-form {
  margin-top: 4px;
}

.order-sub-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-sub-edit-input {
  font-size: 0.8rem;
  padding: 10px 12px;
  word-break: break-all;
}

.order-sub-edit-actions {
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .order-sub-edit-fields {
    flex-direction: row;
    align-items: center;
  }

  .order-sub-edit-input {
    flex: 1 1 240px;
    min-width: 0;
  }

  .order-sub-edit-actions {
    flex: 0 0 auto;
  }
}

.customer-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customer-page--detail .list-panel {
  margin-bottom: 0;
}

.customer-page--detail .list-search-wrap {
  margin-bottom: 12px;
}

.customer-page--detail .list-search-wrap .form-control {
  background: var(--surface-solid);
}

.customer-block {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  min-width: 0;
}

.customer-block::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--gradient-surface);
  pointer-events: none;
}

.customer-profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-profile-info {
  flex: 1 1 200px;
  min-width: 0;
}

.customer-profile-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.customer-profile-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.customer-profile-actions {
  flex: 0 1 auto;
  max-width: 100%;
}

.customer-inline-form {
  margin-top: 12px;
}

.customer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.2));
}

.customer-accordion.customer-block {
  padding: 0;
  overflow: hidden;
}

.customer-accordion > summary.customer-section-head {
  list-style: none;
  cursor: pointer;
  margin-bottom: 0;
  padding: 14px 16px;
  border-bottom: none;
  user-select: none;
  transition: background 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.customer-accordion > summary.customer-section-head::-webkit-details-marker {
  display: none;
}

.customer-accordion > summary.customer-section-head .customer-section-count {
  margin-inline-start: auto;
}

.customer-accordion[open] > summary.customer-section-head {
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.2));
}

.customer-accordion > summary.customer-section-head:hover {
  background: rgba(148, 163, 184, 0.06);
}

.customer-accordion .customer-section-body {
  padding: 14px 16px 16px;
}

.customer-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.customer-section-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.customer-section-empty {
  padding: 16px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.customer-section .pagination {
  margin-top: 12px;
}

.customer-section .admin-order-item:first-of-type {
  margin-top: 0;
}

.customer-section .list-item-title,
.customer-section .list-item-sub,
.customer-section .sub-link {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.customer-list-item {
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.customer-list-item:hover {
  background: rgba(148, 163, 184, 0.08);
}

.customer-list-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.customer-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
}

.customer-back-link:hover {
  color: var(--primary, #3b82f6);
}

@media (max-width: 767px) {
  .customer-page--detail,
  .customer-detail {
    min-width: 0;
    max-width: 100%;
  }

  .customer-page--detail {
    margin-bottom: 12px;
  }

  .customer-block {
    padding: 12px;
  }

  .customer-profile-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .customer-profile-info {
    flex: 0 0 auto;
  }

  .customer-profile-name {
    font-size: 1.05rem;
  }

  .customer-profile-actions {
    flex: 0 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .customer-profile-actions .inline-form {
    display: contents;
    margin: 0;
    padding: 0;
  }

  .customer-profile-actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 6px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .customer-section .admin-order-item > .list-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px 0;
  }

  .customer-section .admin-order-actions-btns {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .customer-section .admin-order-actions-btns .order-cancel-form,
  .customer-section .admin-order-actions-btns .order-revoke-sub-form {
    display: flex;
    width: 100%;
  }

  .customer-section .admin-order-actions-btns .btn {
    width: 100%;
  }

  .customer-section .trans-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .customer-section .trans-item-aside {
    align-items: flex-start;
  }

  .customer-inline-form.user-credit-form .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-inline-form.user-credit-form .credit-op-group,
  .customer-inline-form.user-credit-form .credit-submit-group {
    min-width: 0;
    width: 100%;
  }

  .customer-inline-form.user-credit-form .credit-form-action {
    width: 100%;
  }
}

.order-cancel-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.order-cancel-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.order-cancel-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: var(--card-bg, #1e293b);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.order-cancel-modal-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.order-cancel-modal-sub {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--text-muted, #94a3b8);
}

.order-cancel-modal-alert {
  margin: 0 0 12px;
  font-size: 0.82rem;
}

.order-cancel-modal-usage {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.6;
}

.order-cancel-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.order-cancel-modal-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.order-cancel-modal-pending {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--warning, #fbbf24);
}

.order-cancel-modal-total {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.order-cancel-modal-note {
  margin: 0 0 14px;
  font-size: 0.78rem;
  line-height: 1.6;
}

.order-cancel-modal-actions {
  display: flex;
  gap: 10px;
}

.order-cancel-modal-actions .btn {
  flex: 1;
}

.order-cancel-modal-error {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--danger, #f87171);
}

@media (max-width: 520px) {
  .order-cancel-modal-grid {
    grid-template-columns: 1fr;
  }
}

.marzban-renew-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--card-bg, #1e293b);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-size: 0.88rem;
  color: var(--text, #e2e8f0);
  text-align: center;
  line-height: 1.5;
}

.marzban-renew-toast::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: marzban-renew-spin 0.7s linear infinite;
}

.marzban-renew-toast--success::before,
.marzban-renew-toast--error::before {
  display: none;
}

.marzban-renew-toast--success {
  color: var(--success, #34d399);
}

.marzban-renew-toast--error {
  color: var(--danger, #f87171);
}

@keyframes marzban-renew-spin {
  to { transform: rotate(360deg); }
}

.qr-lightbox-panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px 20px 16px;
  max-width: min(100%, 320px);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.qr-lightbox-title {
  color: #1a2332;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.qr-lightbox-canvas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 240px;
}

.qr-lightbox-canvas img,
.qr-lightbox-canvas canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Plan dropdown */
.plan-select {
  position: relative;
  z-index: 1;
}

.plan-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

.plan-note-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--warning, #f59e0b);
}

.plan-note-icon--benefit {
  color: var(--primary-hover);
}

.plan-note strong {
  color: var(--text);
  font-weight: 600;
}

.plan-note-emphasis {
  color: #fff;
  font-weight: 700;
}

.plan-note a {
  color: var(--primary-hover);
  text-decoration: none;
}

.plan-note a:hover {
  text-decoration: underline;
}

.plan-select.open {
  z-index: 120;
}

.card:has(.plan-select.open) {
  z-index: 110;
}

.plan-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 6px;
  isolation: isolate;
}

.plan-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-solid);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: right;
  transition: background 0.15s;
}

.plan-select-option:hover {
  background: rgba(255, 255, 255, 0.04);
}

.plan-select-option.selected {
  background: rgba(var(--primary-rgb), 0.08);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.28);
  color: var(--primary-hover);
}

.plan-select-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface2-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.plan-select-toggle:hover,
.plan-select.open .plan-select-toggle {
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.plan-select-main {
  flex: 1;
  font-weight: 600;
  text-align: right;
}

.plan-select-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  font-size: 0;
  color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}

.plan-select.open .plan-select-arrow {
  transform: rotate(180deg);
}

.plan-select-option-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Checkout â€” buy / renew final price */
.checkout-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.checkout-price-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.checkout-price-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-info {
  background: var(--surface2);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.card-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.card-info-row + .card-info-row {
  border-top: 1px solid var(--border);
}

.ops-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: -8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}

.ops-notice-icon {
  flex-shrink: 0;
  line-height: 1.5;
}

.ops-notice-text {
  flex: 1;
  min-width: 0;
}

.ops-notice--inline {
  margin-top: 0;
  margin-bottom: 16px;
}

.copy-card-btn {
  width: 100%;
  margin-top: 8px;
}

.charge-method-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.charge-method-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(var(--primary-rgb), 0.14);
  color: var(--primary);
  margin-bottom: 4px;
}

.charge-trx-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}

.charge-trx-qr {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.charge-trx-qr img {
  display: block;
}

.charge-pay-wallet {
  font-size: 0.82rem;
  word-break: break-all;
  white-space: normal;
  line-height: 1.5;
  min-width: 0;
  flex: 1 1 100%;
}

.charge-step2 {
  display: flex;
  flex-direction: column;
}

.charge-step2 > * + * {
  margin-top: 12px;
}

.charge-step2 form + form {
  margin-top: 10px;
}

.charge-pay-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: 10px;
  margin: 0;
}

.charge-pay-row + .charge-pay-row {
  margin-top: 8px;
}

.charge-pay-label {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.charge-pay-amount,
.charge-pay-card {
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  word-break: break-all;
}

.charge-pay-row .copy-card-btn {
  width: auto;
  min-width: 60px;
  margin: 0;
  padding: 6px 12px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .charge-pay-row {
    gap: 8px;
  }

  .charge-pay-label {
    flex: 1 1 100%;
  }

  .charge-pay-amount,
  .charge-pay-card {
    text-align: right;
  }
}

.charge-step2-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 20px 0 0;
  line-height: 1.7;
  text-align: center;
}

.charge-step2 .form-group {
  margin: 0 0 20px;
}

.charge-step2 .ops-notice {
  margin-top: 0;
  margin-bottom: 20px;
}

.list-item-sub--rial {
  font-weight: 500;
  color: var(--text);
}

/* Upload box */
.upload-box {
  position: relative;
}

.upload-box:not(.has-file) {
  padding: 0;
  border: none;
  background: transparent;
  cursor: default;
  text-align: right;
}

.upload-box:not(.has-file):hover {
  border: none;
  background: transparent;
}

.upload-box:not(.has-file) .upload-selected {
  display: none !important;
}

.upload-box.has-file {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 12px;
  cursor: default;
}

.upload-box.has-file .upload-placeholder {
  display: none !important;
}

.upload-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-placeholder {
  width: 100%;
}

.receipt-upload-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: var(--surface2);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.receipt-upload-picker:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.06);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08);
}

.receipt-upload-picker:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.receipt-upload-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(var(--primary-rgb), 0.12);
  border-radius: 12px;
  line-height: 1;
  color: var(--primary);
}

.receipt-upload-copy {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.receipt-upload-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

.receipt-upload-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.receipt-upload-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.7;
}

.upload-selected img,
.upload-preview-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
  margin-bottom: 10px;
}

.upload-preview-img:not([src]) {
  display: none;
}

.upload-selected-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upload-filename {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: right;
}

.receipt-thumb-link {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.receipt-thumb {
  max-width: 120px;
  max-height: 80px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}

.receipt-view-link {
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.upload-missing-placeholder {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  text-align: center;
  box-sizing: border-box;
}

.upload-missing-placeholder--receipt {
  max-width: 120px;
  min-height: 80px;
  margin-top: 8px;
}

.upload-missing-placeholder--ticket {
  max-width: 220px;
  min-width: 140px;
  min-height: 100px;
  margin-top: 8px;
}

.upload-missing-placeholder--inline {
  flex-direction: row;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 10px;
  min-height: 0;
  max-width: none;
  border-style: solid;
  font-size: 0.85rem;
}

.upload-missing-placeholder__icon {
  opacity: 0.55;
}

.upload-missing-placeholder__label {
  font-size: 0.75rem;
  line-height: 1.35;
}

.receipt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 24px;
}

.receipt-lightbox.hidden {
  display: none;
}

.receipt-lightbox img {
  max-width: min(100%, 520px);
  max-height: calc(100vh - 72px);
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.receipt-lightbox__missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  border-radius: 12px;
  background: var(--surface2-solid);
  color: var(--text-muted);
  max-width: min(100%, 360px);
  text-align: center;
}

.receipt-lightbox__missing .icon {
  opacity: 0.55;
}

@media (min-width: 992px) {
  .receipt-lightbox:not(.qr-lightbox) img {
    max-width: min(96vw, 1100px);
    max-height: calc(100vh - 96px);
  }
}

.receipt-lightbox-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

body.receipt-lightbox-open {
  overflow: hidden;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.9rem;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.page-subtitle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ticket-list-item {
  text-decoration: none;
  color: inherit;
}

.ticket-list-item:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.03));
}

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
}

.ticket-message {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  gap: 4px;
}

.ticket-message-out {
  align-self: flex-end;
  align-items: flex-end;
}

.ticket-message-in {
  align-self: flex-start;
  align-items: flex-start;
}

.ticket-message-inner {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  max-width: 100%;
}

.ticket-message-out .ticket-message-inner {
  flex-direction: row-reverse;
}

.ticket-message-in .ticket-message-inner {
  flex-direction: row;
}

.ticket-message-inner .ticket-bubble {
  min-width: 0;
  flex: 1 1 auto;
}

.ticket-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.55;
  word-break: break-word;
}

.ticket-message-out .ticket-bubble {
  background: rgba(var(--primary-rgb), 0.22);
  border: 1px solid rgba(var(--primary-rgb), 0.28);
  border-bottom-left-radius: 4px;
}

.ticket-message-in .ticket-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-bottom-right-radius: 4px;
}

.ticket-message-auto .ticket-bubble {
  background: rgba(var(--warning-rgb), 0.1);
  border: 1px dashed rgba(var(--warning-rgb), 0.4);
  color: var(--text-muted);
}

.ticket-message-auto .ticket-message-time {
  color: var(--warning);
}

.ticket-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ticket-message-out .ticket-message-meta {
  flex-direction: row-reverse;
}

.ticket-message-author {
  font-weight: 600;
}

.ticket-message-out .ticket-message-author {
  color: var(--primary);
}

.ticket-message-body {
  font-size: 0.95rem;
}

.ticket-message-deleted {
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.85;
}

.ticket-message-edited {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.9;
}

.ticket-message-menu {
  flex-shrink: 0;
  margin: 0;
  align-self: flex-end;
  margin-bottom: 4px;
}

.ticket-message-menu.hidden {
  display: none;
}

.ticket-message-menu-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  opacity: 0.55;
}

.ticket-message-menu-toggle:hover,
.ticket-message-menu.is-open .ticket-message-menu-toggle {
  opacity: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: none;
}

.ticket-message-menu-dropdown {
  min-width: 132px;
}

.ticket-message-body:empty {
  display: none;
}

.ticket-message-body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.ticket-message-out .ticket-message-body a {
  font-weight: 600;
}

.ticket-bubble .ticket-attachment-link:first-child {
  margin-top: 0;
}

.ticket-bubble .upload-missing-placeholder--ticket:first-child {
  margin-top: 0;
}

.ticket-attachment-link {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.ticket-attachment-thumb {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  object-fit: cover;
}

.ticket-live-toast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--surface2-solid);
  border: 1px solid rgba(var(--success-rgb), 0.55);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.48);
}

.ticket-live-toast .icon {
  color: var(--success);
  flex-shrink: 0;
}

.ticket-live-toast.hidden {
  display: none;
}

.ticket-chat-page {
  --compose-height: 64px;
  --ticket-nav-offset: 0px;
  --ticket-compose-gap: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-bottom: calc(var(--compose-height) + var(--ticket-nav-offset) + var(--ticket-compose-gap));
}

.has-bottom-nav .ticket-chat-page {
  --ticket-nav-offset: var(--nav-height);
}

body.ticket-chat-active {
  overflow: hidden;
  height: var(--ticket-vvh, 100dvh);
  max-height: var(--ticket-vvh, 100dvh);
  display: flex;
  flex-direction: column;
}

body.ticket-chat-active .header,
body.ticket-chat-active .site-notice {
  flex-shrink: 0;
}

body.ticket-chat-active .container,
body.ticket-chat-active .container-wide {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
  margin-bottom: 0;
  height: auto;
  max-height: none;
}

body.ticket-chat-active.has-bottom-nav {
  padding-bottom: 0;
}

.ticket-chat-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.ticket-chat-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  line-height: 1.2;
  padding: 6px 0;
}

.ticket-chat-header-top .back-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.2;
}

.ticket-chat-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-chat-header .back-link {
  margin-bottom: 0;
}

.ticket-chat-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ticket-chat-header .page-title,
.ticket-chat-header .ticket-chat-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

.ticket-subtitle-row.ticket-subtitle-row,
.ticket-chat-header .page-subtitle-row {
  margin-bottom: 0;
}

.ticket-chat-actions {
  margin: 0;
}

.ticket-chat-actions form {
  margin: 0;
}

.ticket-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.ticket-thread-end {
  height: 1px;
  overflow: hidden;
}

.ticket-compose-closed {
  margin-top: 12px;
  margin-bottom: 0;
}

.ticket-compose-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 110;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}

.has-bottom-nav .ticket-compose-bar {
  bottom: calc(var(--nav-height) + 4px);
}

.canned-replies {
  position: relative;
  margin-bottom: 8px;
}

.canned-replies-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.canned-replies-toggle:hover {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text);
}

.canned-replies-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface, #1e293b);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.canned-replies-menu.hidden {
  display: none;
}

.canned-replies-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: right;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.canned-replies-item:hover {
  background: rgba(148, 163, 184, 0.14);
}

.canned-replies-item-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.canned-replies-item-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

body.ticket-compose-keyboard-open .ticket-compose-bar {
  padding-bottom: 10px;
}

@media (max-width: 640px) {
  body.ticket-chat-active .bottom-nav {
    display: none;
  }

  body.ticket-chat-active .container {
    padding-top: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }

  body.ticket-chat-active .ticket-chat-page {
    --ticket-nav-offset: 0px;
    --ticket-compose-gap: 8px;
    padding-bottom: 0;
    position: relative;
  }

  body.ticket-chat-active .ticket-chat-header {
    gap: 4px;
    margin-bottom: 4px;
  }

  body.ticket-chat-active .ticket-chat-header-top {
    padding: 8px 0;
  }

  body.ticket-chat-active .ticket-chat-header .page-title,
  body.ticket-chat-active .ticket-chat-header .ticket-chat-title {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  body.ticket-chat-active .ticket-chat-header-top .back-link {
    font-size: 0.85rem;
    line-height: 1.2;
  }

  body.ticket-chat-active .ticket-subtitle-row {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
  }

  body.admin-body.ticket-chat-active [data-live-region="ticket_status"] {
    display: none;
  }

  body.ticket-chat-active .ticket-live-toast {
    position: absolute;
    left: 10px;
    right: 10px;
    z-index: 12;
    margin-bottom: 0;
    padding: 6px 10px;
    font-size: 0.8rem;
    top: var(--ticket-toast-top, 0);
  }

  body.ticket-chat-active .ticket-messages {
    flex: 0 0 auto;
    min-height: 0;
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    scroll-padding-bottom: 8px;
  }

  body.ticket-chat-active .ticket-compose-bar {
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  body.ticket-chat-active.has-bottom-nav .ticket-compose-bar {
    bottom: 0;
  }

  body.ticket-compose-keyboard-open.ticket-chat-active .ticket-compose-bar {
    padding-bottom: 8px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

/* Ù…ÙˆØ¨Ø§ÛŒÙ„ Ø§Ø¯Ù…ÛŒÙ†: Ù†Ø§ÙˆØ¨Ø±ÛŒ Ù…Ø®ÙÛŒ + Ø²Ù†Ø¬ÛŒØ±Ù‡Ù” flex Ø¨Ø±Ø§ÛŒ Ù¾Ø± Ø´Ø¯Ù† Ø§Ø±ØªÙØ§Ø¹ Ú†Øª ØªÛŒÚ©Øª */
@media (max-width: 991px) {
  body.admin-body.ticket-chat-active .admin-nav[data-admin-nav] {
    display: none;
  }

  body.admin-body.ticket-chat-active .admin-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.admin-body.ticket-chat-active .ticket-chat-page {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 0;
    position: relative;
  }

  body.admin-body.ticket-chat-active .ticket-live-toast {
    position: absolute;
    left: 10px;
    right: 10px;
    z-index: 12;
    margin-bottom: 0;
    padding: 6px 10px;
    font-size: 0.8rem;
    top: var(--ticket-toast-top, 0);
  }

  body.admin-body.ticket-chat-active .ticket-messages {
    flex: 0 0 auto;
  }
}

.ticket-compose-bar-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.ticket-compose-form {
  margin: 0;
}

.ticket-compose-preview {
  margin-bottom: 8px;
}

.ticket-compose-preview.hidden {
  display: none;
}

.ticket-compose-error {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(var(--danger-rgb), 0.12);
  border: 1px solid rgba(var(--danger-rgb), 0.35);
  color: var(--danger);
  font-size: 0.82rem;
}

.ticket-compose-error.hidden {
  display: none;
}

.ticket-compose-preview-inner {
  position: relative;
  display: inline-block;
}

.ticket-compose-preview-img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.ticket-compose-preview-remove {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.ticket-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.ticket-compose-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.ticket-compose-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.ticket-compose-input:focus {
  border-color: var(--primary);
}

.ticket-compose-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, opacity 0.2s;
}

.ticket-compose-btn .icon {
  margin: 0 auto;
}

.ticket-compose-attach {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 1.15rem;
}

.ticket-compose-attach:hover {
  background: var(--border);
  color: var(--text);
}

.ticket-compose-send {
  background: var(--gradient-brand);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.35);
}

.ticket-compose-send:hover:not(:disabled) {
  background: var(--gradient-brand);
  filter: brightness(1.06);
}

.ticket-compose-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ticket-new-card .ticket-compose {
  margin-top: 4px;
}

.ticket-new-card .ticket-compose-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4px 4px 4px 8px;
}

.ticket-new-card .ticket-compose-input {
  border: none;
  background: transparent;
  border-radius: 20px;
}

.ticket-new-card .ticket-compose-input:focus {
  border: none;
  box-shadow: none;
}

.api-doc-pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
  direction: ltr;
  text-align: left;
}

.api-doc-pre:last-child {
  margin-bottom: 0;
}

.api-doc-pre code {
  font-family: var(--font-en);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}

.api-doc-code {
  font-family: var(--font-en);
  direction: ltr;
  text-align: left;
}

.api-doc-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.api-doc-label:not(:first-child) {
  margin-top: 8px;
}


/* Jalali datepicker â€” dark theme */
jdp-container,
jdp-overlay {
  box-sizing: border-box;
}

jdp-container {
  background: var(--surface-solid) !important;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg) !important;
  color: var(--text) !important;
  font-family: var(--font);
}

jdp-container .jdp-month,
jdp-container .jdp-month input,
jdp-container .jdp-month select,
jdp-container .jdp-year,
jdp-container .jdp-year input,
jdp-container .jdp-year select {
  background: transparent !important;
  color: var(--text) !important;
}

jdp-container .jdp-month select,
jdp-container .jdp-year select {
  background: var(--surface2) !important;
  border-radius: 6px;
  padding: 2px 4px;
}

jdp-container .jdp-month select option,
jdp-container .jdp-year select option {
  background: var(--surface);
  color: var(--text);
}

jdp-container .jdp-months,
jdp-container .jdp-years {
  color: var(--text) !important;
  fill: var(--text) !important;
}

jdp-container .jdp-icon-minus,
jdp-container .jdp-icon-plus {
  border-color: var(--border) !important;
  color: var(--text);
}

jdp-container .jdp-icon-minus svg,
jdp-container .jdp-icon-plus svg {
  fill: currentColor !important;
}

jdp-container .jdp-icon-minus svg path,
jdp-container .jdp-icon-plus svg path {
  fill: currentColor !important;
}

jdp-container .jdp-day,
jdp-container .jdp-day-name {
  color: var(--text) !important;
}

jdp-container .jdp-day-name {
  background-color: var(--surface2) !important;
}

jdp-container .jdp-day.not-in-month {
  color: var(--text-muted) !important;
}

jdp-container .jdp-day:not(.disabled-day):hover {
  background: rgba(var(--primary-rgb), 0.18) !important;
}

jdp-container .jdp-day-name.selected,
jdp-container .jdp-day.selected {
  background-color: var(--primary) !important;
  color: #fff !important;
}

jdp-container .jdp-day-name.holly-day,
jdp-container .jdp-day-name.last-week,
jdp-container .jdp-day.holly-day,
jdp-container .jdp-day.last-week {
  color: #f87171 !important;
}

jdp-container .jdp-btn-close,
jdp-container .jdp-btn-empty,
jdp-container .jdp-btn-today {
  background: var(--primary) !important;
  color: #fff !important;
}

jdp-overlay {
  background-color: rgba(0, 0, 0, 0.45) !important;
}

.maintenance-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

.maintenance-shell {
  width: 100%;
  max-width: 420px;
}

.maintenance-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.maintenance-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-bottom: 16px;
  color: var(--primary);
}

.maintenance-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.maintenance-text {
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.maintenance-brand {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.support-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-faq-item {
  background: var(--surface2-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.support-faq-item:hover {
  border-color: var(--border-strong);
}

.support-faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.7;
}

.support-faq-item > summary::-webkit-details-marker {
  display: none;
}

.support-faq-item[open] > summary {
  border-bottom: 1px solid var(--border);
}

.support-faq-answer {
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.support-faq-editor {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.support-faq-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.support-faq-editor-order {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.support-faq-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-faq-editor-moves {
  display: flex;
  gap: 6px;
}

.support-faq-editor-moves .btn {
  min-width: 40px;
  padding-left: 10px;
  padding-right: 10px;
}

.support-faq-editor-moves .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.support-faq-editor .form-group:last-of-type {
  margin-bottom: 12px;
}

.payment-card-editor .form-group:last-of-type {
  margin-bottom: 0;
}

.payment-card-editor {
  margin-bottom: 10px;
  --payment-card-control-h: 42px;
}

.payment-card-editor:last-of-type {
  margin-bottom: 0;
}

.payment-card-editor .support-faq-editor-toolbar {
  align-items: center;
}

.payment-card-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 10px;
  align-items: end;
}

.payment-card-label-group,
.payment-card-number-group {
  margin-bottom: 0;
  min-width: 0;
}

.payment-card-editor .payment-card-fields .form-group {
  margin-bottom: 0;
}

.payment-card-label-group label,
.payment-card-number-group label {
  display: block;
  min-height: 20px;
  line-height: 20px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.payment-card-fields .form-control {
  height: var(--payment-card-control-h);
  padding: 0 14px;
  box-sizing: border-box;
  font-size: 0.9rem;
  line-height: 1;
}

.payment-card-label-input {
  margin: 0;
}

@media (max-width: 560px) {
  .payment-card-fields {
    grid-template-columns: 1fr;
  }
}

.payment-card-active-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  user-select: none;
  height: 32px;
}

.payment-card-active-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.payment-card-active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  pointer-events: none;
}

.payment-card-active-dot {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
  flex: 0 0 14px;
}

.payment-card-active-label:has(input:checked) .payment-card-active-badge {
  color: var(--success);
  background: rgba(var(--success-rgb), 0.14);
  border-color: rgba(var(--success-rgb), 0.35);
}

.payment-card-active-label:has(input:checked) .payment-card-active-dot {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 2px var(--surface2-solid);
}

.rate-limit-intro {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--muted);
  margin: 0 0 16px;
}

.rate-limit-global {
  margin-bottom: 4px;
}

.rate-limit-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.rate-limit-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.rate-limit-item-head {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  margin-bottom: 0;
}

.rate-limit-item:not(:has(.rate-limit-item-head input[type="checkbox"]:checked)) .rate-limit-item-fields {
  display: none;
}

.rate-limit-item:not(:has(.rate-limit-item-head input[type="checkbox"]:checked)) .rate-limit-item-head {
  border-bottom: none;
}

.rate-limit-item-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 14px 16px 16px;
}

.rate-limit-item-fields .form-group {
  margin-bottom: 0;
}

.rate-limit-item-fields label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

@media (max-width: 560px) {
  .rate-limit-item-fields {
    grid-template-columns: 1fr;
  }
}

.backup-intro {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 14px;
}

.backup-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.backup-section-group {
  margin-bottom: 16px;
}

.backup-section-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.backup-section-group-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.backup-section-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.backup-section-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.backup-section-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.backup-section-item-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.backup-section-item-desc {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.backup-section-item-stat {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .backup-section-item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "info toggle"
      "stat toggle";
  }

  .backup-section-item-info { grid-area: info; }
  .backup-section-item-stat {
    grid-area: stat;
    white-space: normal;
  }

  .backup-section-item .settings-toggle-control {
    grid-area: toggle;
  }
}

