/**
 * Premium panel UI — light default, dark optional (html[data-theme="dark"]).
 * Professional indigo / slate palette; theme via public/js/premium-theme.js.
 */
:root {
  color-scheme: light;
  --accent-rgb: 79 70 229;
  --bg: #f6f7f9;
  --bg-subtle: #eceff4;
  --bg-card: #ffffff;
  --bg-elevated: #fafbfc;
  --border: rgba(15, 23, 42, 0.1);
  --border-muted: rgba(15, 23, 42, 0.07);
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-deep: #4338ca;
  --on-accent: #ffffff;
  --accent-muted: rgb(var(--accent-rgb) / 0.1);
  --accent-glow: transparent;
  --shadow-hover-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-hover-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-hover-lg: 0 6px 20px rgba(15, 23, 42, 0.07);
  --success: #0d6e4d;
  --success-bg: rgba(13, 110, 77, 0.09);
  --success-border: rgba(13, 110, 77, 0.26);
  --danger: #b42318;
  --danger-bg: rgba(180, 35, 24, 0.08);
  --danger-border: rgba(180, 35, 24, 0.25);
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 4px 24px rgba(15, 23, 42, 0.05);
  --sidebar-w: 276px;
  --sidebar-bg: #ffffff;
  --sidebar-accent: none;
  --nav-active-bg: #f1f5f9;
  --nav-active-border: rgba(15, 23, 42, 0.08);
  --nav-hover-bg: rgba(15, 23, 42, 0.04);
  --nav-label-color: rgba(15, 23, 42, 0.45);
  --nav-item-color: rgba(15, 23, 42, 0.78);
  --nav-dropdown-color: rgba(15, 23, 42, 0.82);
  --sidebar-shadow: 1px 0 0 rgba(15, 23, 42, 0.06);
  --header-bg: #ffffff;
  --auth-card-bg: #ffffff;
  --wallet-hover-bg: #e2e8f0;
  --wallet-pill-color: #0f172a;
  --wallet-pill-bg: #f1f5f9;
  --wallet-pill-border: rgba(15, 23, 42, 0.1);
  --body-bg-image: none;
  --auth-bg-image: none;
  --table-row-hover: rgba(15, 23, 42, 0.045);
  --font-ui: "Outfit", system-ui, -apple-system, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.2s var(--ease-out);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --accent-rgb: 129 140 248;
  --bg: #09090b;
  --bg-subtle: #0e0e12;
  --bg-card: #13131a;
  --bg-elevated: #1a1a24;
  --border: rgb(var(--accent-rgb) / 0.14);
  --border-muted: rgba(255, 255, 255, 0.06);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-deep: #6366f1;
  --on-accent: #f8fafc;
  --accent-muted: rgb(var(--accent-rgb) / 0.16);
  --accent-glow: rgb(var(--accent-rgb) / 0.25);
  --shadow-hover-sm: 0 4px 16px var(--accent-glow);
  --shadow-hover-md: 0 6px 22px var(--accent-glow);
  --shadow-hover-lg: 0 8px 28px var(--accent-glow);
  --success: #6ee7b7;
  --success-bg: rgba(52, 211, 153, 0.12);
  --success-border: rgba(52, 211, 153, 0.35);
  --danger: #fca5a5;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --danger-border: rgba(248, 113, 113, 0.35);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.25);
  --sidebar-bg: #060608;
  --sidebar-accent: linear-gradient(180deg, rgb(var(--accent-rgb) / 0.1) 0%, transparent 50%);
  --nav-active-bg: rgb(var(--accent-rgb) / 0.14);
  --nav-active-border: rgb(var(--accent-rgb) / 0.32);
  --nav-hover-bg: rgba(255, 255, 255, 0.05);
  --nav-label-color: rgba(241, 245, 249, 0.38);
  --nav-item-color: rgba(241, 245, 249, 0.82);
  --nav-dropdown-color: rgba(241, 245, 249, 0.88);
  --sidebar-shadow: 4px 0 40px rgba(0, 0, 0, 0.4);
  --header-bg: rgba(19, 19, 26, 0.82);
  --auth-card-bg: rgba(19, 19, 26, 0.75);
  --wallet-hover-bg: rgb(var(--accent-rgb) / 0.2);
  --wallet-pill-color: var(--accent-hover);
  --wallet-pill-bg: var(--accent-muted);
  --wallet-pill-border: var(--border);
  --body-bg-image:
    radial-gradient(ellipse 100% 80% at 50% -40%, rgb(var(--accent-rgb) / 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(99, 102, 241, 0.07), transparent 50%);
  --auth-bg-image:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgb(var(--accent-rgb) / 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(99, 102, 241, 0.08), transparent 45%);
  --table-row-hover: rgba(255, 255, 255, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body.premium-body {
  font-family: var(--font-ui);
  background: var(--bg);
  background-image: var(--body-bg-image);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 0.875rem;
  -webkit-font-smoothing: antialiased;
  display: flex;
}

.sidebar-brand a,
.header h1,
.svc-heading,
.kpi-section-title,
.notices-title,
.add-money-heading,
.vc-page-header h1,
.vc-show-name {
  font-family: var(--font-display);
}

/* —— Sidebar —— */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  background-image: var(--sidebar-accent);
  border-right: 1px solid var(--border-muted);
  display: flex;
  flex-direction: column;
  z-index: 40;
  box-shadow: var(--sidebar-shadow);
}

.sidebar-brand {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-muted);
}

.sidebar-brand a {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.sidebar-brand a:hover {
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--nav-label-color);
  padding: 0.65rem 1.1rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  margin: 0 0.5rem 0.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--nav-item-color);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text);
  background: var(--nav-hover-bg);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--text);
  font-weight: 600;
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
  box-shadow: none;
}

html[data-theme="dark"] .nav-item.active {
  box-shadow: 0 0 20px var(--accent-glow);
}

.nav-icon {
  width: 1.05rem;
  height: 1.05rem;
  opacity: 0.88;
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--accent);
}

.nav-item.nav-item--sub {
  margin-left: 1.1rem;
  margin-right: 0.65rem;
  padding-left: 0.75rem;
  font-size: 0.78rem;
  color: var(--nav-item-color);
  opacity: 0.95;
}

.nav-item.nav-item--sub .nav-icon {
  width: 0.95rem;
  height: 0.95rem;
  opacity: 0.8;
}

.nav-divider {
  height: 1px;
  background: var(--border-muted);
  margin: 0.5rem 1rem 0.55rem;
}

.nav-dropdown {
  margin: 0 0.5rem 0.25rem;
  border-radius: var(--radius-sm);
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--nav-dropdown-color);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
}

.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger {
  color: var(--text);
  background: var(--nav-hover-bg);
}

.nav-dropdown-trigger .nav-dropdown-chevron {
  width: 1rem;
  height: 1rem;
  opacity: 0.75;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.nav-dropdown.open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s var(--ease-out);
}

.nav-dropdown.open .nav-dropdown-menu {
  max-height: 280px;
}

.nav-dropdown-menu .nav-item {
  margin: 0 0.25rem 0.1rem 0.85rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  border-left: 2px solid transparent;
}

.nav-dropdown-menu .nav-item.active {
  border-left-color: var(--accent);
}

.brand-mobile {
  display: none;
}

.layout-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  margin-left: var(--sidebar-w);
}

.header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-muted);
  padding: 0.85rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

html[data-theme="dark"] .header {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-user {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.wallet-amount {
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--wallet-pill-color);
  background: var(--wallet-pill-bg);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--wallet-pill-border);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.wallet-amount:hover {
  box-shadow: none;
  transform: translateY(-1px);
  background: var(--wallet-hover-bg);
  border-color: var(--border);
}

html[data-theme="dark"] .wallet-amount:hover {
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-logout {
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 0.35rem 0;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-logout:hover {
  color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border);
  background: var(--bg-subtle);
  box-shadow: none;
}

html[data-theme="dark"] .theme-toggle:hover {
  background: var(--accent-muted);
  box-shadow: 0 0 16px var(--accent-glow);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

html[data-theme="dark"] .theme-toggle-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle-sun,
html:not([data-theme]) .theme-toggle-sun {
  display: none;
}

.auth-theme-wrap {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
}

.main {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
  overflow-y: auto;
  max-width: none;
  margin: 0;
  width: 100%;
  min-width: 0;
}

.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  animation: alert-in 0.45s var(--ease-out) both;
}

@keyframes alert-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.alert-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.35rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.panel-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.panel-card.card-accent-blue::before {
  background: linear-gradient(180deg, #7c9eff, #4f6ed4);
}
.panel-card.card-accent-violet::before {
  background: linear-gradient(180deg, #b794f6, #7c5cbf);
}
.panel-card.card-accent-emerald::before {
  background: linear-gradient(180deg, #5eead4, #2dd4bf);
}
.panel-card.card-accent-orange::before {
  background: linear-gradient(180deg, #fcd34d, #d97706);
}
.panel-card.card-accent-rose::before {
  background: linear-gradient(180deg, #fb7185, #e11d48);
}
.panel-card.card-accent-cyan::before {
  background: linear-gradient(180deg, #67e8f9, #0891b2);
}

/* —— Shared: filters, tables, buttons —— */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.filter-form {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}

.filter-form form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.filter-form input,
.filter-form select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  background: var(--bg-subtle);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-form input:focus,
.filter-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.filter-form button {
  padding: 0.45rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-form button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover-md);
}

.filter-form .form-group {
  min-width: 0;
}

.filter-form .form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  box-shadow: var(--shadow-soft);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.table-wrap th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-wrap tbody tr {
  transition: background var(--transition-fast);
}

.table-wrap tbody tr:hover {
  background: var(--table-row-hover);
}

.table-wrap td .btn-sm + .btn-sm {
  margin-inline-start: 0.4rem;
}

/* Table row actions — icon-only, color-coded (reference: clean action column) */
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: nowrap;
}

.table-action-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast), transform 0.12s ease;
}

a.table-action {
  text-decoration: none;
}

a.table-action:hover,
a.table-action:focus {
  text-decoration: none;
}

.table-action:hover {
  background: var(--table-row-hover);
}

.table-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.table-action:active {
  transform: scale(0.94);
}

.table-action__svg {
  width: 1.22rem;
  height: 1.22rem;
  flex-shrink: 0;
  display: block;
}

/* Chained selectors so anchor/button keep semantic colors (beat browser / link defaults) */
.table-action.table-action--view,
a.table-action.table-action--view,
button.table-action.table-action--view {
  color: #16a34a;
}

.table-action.table-action--edit,
a.table-action.table-action--edit,
button.table-action.table-action--edit {
  color: #eab308;
}

.table-action.table-action--delete,
a.table-action.table-action--delete,
button.table-action.table-action--delete {
  color: #dc2626;
}

.table-action.table-action--impersonate,
a.table-action.table-action--impersonate,
button.table-action.table-action--impersonate {
  color: #2563eb;
}

.table-action.table-action--approve,
a.table-action.table-action--approve,
button.table-action.table-action--approve {
  color: #059669;
}

.table-action.table-action--reject,
a.table-action.table-action--reject,
button.table-action.table-action--reject {
  color: #dc2626;
}

html[data-theme="dark"] .table-action.table-action--view,
html[data-theme="dark"] a.table-action.table-action--view,
html[data-theme="dark"] button.table-action.table-action--view {
  color: #4ade80;
}

html[data-theme="dark"] .table-action.table-action--edit,
html[data-theme="dark"] a.table-action.table-action--edit,
html[data-theme="dark"] button.table-action.table-action--edit {
  color: #facc15;
}

html[data-theme="dark"] .table-action.table-action--delete,
html[data-theme="dark"] a.table-action.table-action--delete,
html[data-theme="dark"] button.table-action.table-action--delete {
  color: #f87171;
}

html[data-theme="dark"] .table-action.table-action--impersonate,
html[data-theme="dark"] a.table-action.table-action--impersonate,
html[data-theme="dark"] button.table-action.table-action--impersonate {
  color: #93c5fd;
}

html[data-theme="dark"] .table-action.table-action--approve,
html[data-theme="dark"] a.table-action.table-action--approve,
html[data-theme="dark"] button.table-action.table-action--approve {
  color: #34d399;
}

html[data-theme="dark"] .table-action.table-action--reject,
html[data-theme="dark"] a.table-action.table-action--reject,
html[data-theme="dark"] button.table-action.table-action--reject {
  color: #f87171;
}

.table-action.table-action--distributor,
a.table-action.table-action--distributor,
button.table-action.table-action--distributor {
  color: #4f46e5;
}

html[data-theme="dark"] .table-action.table-action--distributor,
html[data-theme="dark"] a.table-action.table-action--distributor,
html[data-theme="dark"] button.table-action.table-action--distributor {
  color: #a5b4fc;
}

.table-action.table-action--muted,
span.table-action.table-action--muted {
  opacity: 0.38;
  cursor: default;
}

/* Wallet top-ups: View + Approve/Reject in one column (reference: plan orders actions) */
.wallet-topups-admin-page .wallet-topup-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
}

.wallet-topups-admin-page .wallet-topup-row-actions .table-actions {
  gap: 0.12rem;
}

.wallet-topups-admin-page .wallet-topup-actions--decide {
  padding-inline-start: 0.4rem;
  margin-inline-start: 0.15rem;
  border-inline-start: 1px solid var(--border-muted);
}

/* Service orders list: view + accept / reject icon buttons */
.admin-service-orders-page .service-order-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
}

.admin-service-orders-page .service-order-row-actions .table-actions {
  gap: 0.12rem;
}

.admin-service-orders-page .service-order-actions--decide {
  padding-inline-start: 0.4rem;
  margin-inline-start: 0.15rem;
  border-inline-start: 1px solid var(--border-muted);
}

/* Admin tickets list: view + inline status icons */
.admin-tickets-page .ticket-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
}

.admin-tickets-page .ticket-row-actions .table-actions {
  gap: 0.12rem;
}

.admin-tickets-page .ticket-actions--status {
  padding-inline-start: 0.4rem;
  margin-inline-start: 0.15rem;
  border-inline-start: 1px solid var(--border-muted);
}

/* Floating tooltip for .table-action[data-tooltip] (see premium-action-tooltip.js) */
.premium-action-tooltip {
  position: fixed;
  z-index: 5000;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0.32rem 0.55rem;
  max-width: calc(100vw - 1rem);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.06),
    0 8px 20px -4px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition:
    opacity 0.12s var(--ease-out),
    transform 0.12s var(--ease-out);
}

.premium-action-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

html[data-theme="dark"] .premium-action-tooltip {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .premium-action-tooltip {
    transition-duration: 0.05s;
    transform: none;
  }

  .premium-action-tooltip.is-visible {
    transform: none;
  }
}

.table-wrap img {
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.btn-sm {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent) !important;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover-sm);
}

.btn-sm.btn-outline {
  background: var(--bg-subtle);
  color: var(--text) !important;
  border: 1px solid var(--border-muted);
  box-shadow: none;
}

.btn-sm.btn-outline:hover {
  transform: translateY(-1px);
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--text) !important;
  box-shadow: var(--shadow-hover-sm);
}

.btn-sm.btn-login-as {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff !important;
  border: 1px solid rgba(13, 148, 136, 0.65);
}

.btn-sm.btn-login-as:hover {
  box-shadow: var(--shadow-hover-sm);
  filter: brightness(1.05);
}

html[data-theme="dark"] .btn-sm.btn-login-as {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #f0fdfa !important;
  border-color: rgba(45, 212, 191, 0.45);
}

.btn-delete {
  /* Legacy: prefer .table-action.table-action--delete in tables */
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-fast);
}

html[data-theme="dark"] .btn-delete {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

html[data-theme="dark"] .btn-delete:hover {
  background: rgba(239, 68, 68, 0.35);
}

.pagination-wrap {
  margin-top: 1rem;
  font-size: 0.8125rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  transition: var(--transition-fast);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination span.current {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--accent-hover);
  font-weight: 600;
}

.pagination span.disabled,
.pagination span[aria-disabled="true"] {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-open {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.badge-processing {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.badge-closed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 640px;
  box-shadow: var(--shadow-soft);
}

.premium-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.premium-modal[hidden] {
  display: none !important;
}

.premium-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

html[data-theme="dark"] .premium-modal-backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.premium-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 32rem;
  max-height: min(92vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  box-shadow:
    0 24px 48px -12px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(15, 23, 42, 0.04);
  animation: premium-modal-in 0.22s var(--ease-out);
}

html[data-theme="dark"] .premium-modal-dialog {
  box-shadow:
    0 24px 48px -8px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.premium-modal--wide .premium-modal-dialog {
  max-width: 38rem;
}

@keyframes premium-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.premium-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.5rem 1.15rem;
  border-bottom: 1px solid var(--border-muted);
  flex-shrink: 0;
}

.premium-modal-heading {
  min-width: 0;
}

.premium-modal-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-family: var(--font-ui);
}

.premium-modal-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.premium-modal-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.premium-modal-close:hover {
  background: var(--border-muted);
  color: var(--text);
}

.premium-modal-body {
  padding: 1.35rem 1.5rem 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.premium-modal-form-body .form-group:last-child {
  margin-bottom: 0;
}

.premium-modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.5rem 1.35rem;
  border-top: 1px solid var(--border-muted);
  flex-shrink: 0;
  background: var(--bg-card);
}

.premium-modal-footer .btn-modal {
  min-width: 5.5rem;
}

.btn-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: var(--font-ui);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-modal-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.btn-modal-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-hover-sm);
}

.btn-modal-primary:active {
  transform: translateY(1px);
}

.btn-modal-secondary {
  background: var(--bg-card);
  border-color: var(--border-muted);
  color: var(--text);
}

.btn-modal-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
}

html[data-theme="dark"] .btn-modal-secondary {
  background: var(--bg-elevated);
}

html[data-theme="dark"] .btn-modal-secondary:hover {
  background: var(--bg-subtle);
}

.premium-modal .error-list {
  margin: 0 0 1.1rem;
  padding: 0.65rem 0.85rem 0.65rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  list-style-position: outside;
}

/* Single form pattern inside modals (reference: label above field, clear footer actions) */
.premium-modal .form-group {
  margin-bottom: 1.15rem;
}

.premium-modal .form-group > label:first-child,
.premium-modal .form-group > label:only-of-type {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
  font-family: var(--font-ui);
}

.premium-modal .form-group:has(> input[required]:not([type="hidden"])) > label:first-child::after,
.premium-modal .form-group:has(> textarea[required]) > label:first-child::after,
.premium-modal .form-group:has(> select[required]) > label:first-child::after {
  content: " *";
  color: var(--danger);
  font-weight: 700;
}

.premium-modal .form-group input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),
.premium-modal .form-group textarea,
.premium-modal .form-group select {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-ui);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

html[data-theme="dark"] .premium-modal .form-group input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),
html[data-theme="dark"] .premium-modal .form-group textarea,
html[data-theme="dark"] .premium-modal .form-group select {
  background: var(--bg-subtle);
}

.premium-modal .form-group input[type="file"] {
  width: 100%;
  padding: 0.45rem 0;
  font-size: 0.8125rem;
  border: none;
  background: transparent;
}

.premium-modal .form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.premium-modal .form-group input::placeholder,
.premium-modal .form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.premium-modal .form-group select {
  appearance: none;
  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='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2.35rem;
}

html[data-theme="dark"] .premium-modal .form-group select {
  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'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.premium-modal .form-group input:not([type="checkbox"]):not([type="file"]):not([type="radio"]):focus,
.premium-modal .form-group textarea:focus,
.premium-modal .form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* Radio rows in modals (new activation — company create vs renew) */
.premium-modal .company-action-box .company-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 520px) {
  .premium-modal .company-action-box .company-options {
    grid-template-columns: 1fr;
  }
}

.premium-modal .company-action-box .company-options label.opt {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  min-height: 2.75rem;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.premium-modal .company-action-box .company-options label.opt input[type="radio"] {
  width: auto !important;
  min-width: 1rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  accent-color: var(--accent);
}

.premium-modal .company-action-box .company-options label.opt span {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text);
}

.premium-modal .company-action-box .company-options label.opt:has(input:checked) span {
  color: var(--text);
}

/* User type radios — compact row, no full-width radios */
.premium-modal .form-group .na-user-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.premium-modal .form-group .na-user-type-row label {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  margin: 0 !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  color: var(--text-muted) !important;
  cursor: pointer;
}

.premium-modal .form-group .na-user-type-row input[type="radio"] {
  width: auto !important;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  accent-color: var(--accent);
}

.premium-modal .form-group label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0;
  cursor: pointer;
}

.premium-modal .form-group label:has(input[type="checkbox"]) input {
  width: auto;
  margin: 0;
}

.premium-modal .text-muted,
.premium-modal .hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

.premium-modal-file-hint {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* —— Toast notifications (flash messages) —— */
.premium-toast-host {
  position: fixed;
  z-index: 4000;
  top: max(1.1rem, env(safe-area-inset-top, 0px));
  right: max(1.1rem, env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  width: min(100vw - 2.25rem, 24.5rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  pointer-events: none;
}

.premium-toast-host .premium-toast {
  pointer-events: auto;
}

.premium-toast {
  --toast-bar: var(--accent);
  --toast-icon-bg: var(--accent-muted);
  --toast-icon-fg: var(--accent);
  position: relative;
  font-family: var(--font-ui);
  border-radius: 14px;
  border: 1px solid var(--border-muted);
  background: var(--bg-card);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 12px 28px -8px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  opacity: 0;
  transform: translateX(calc(100% + 1.25rem)) scale(0.98);
  transition:
    opacity 0.32s var(--ease-out),
    transform 0.38s var(--ease-out);
  overflow: hidden;
}

.premium-toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--toast-bar);
  border-radius: 14px 0 0 14px;
}

html[data-theme="dark"] .premium-toast {
  box-shadow:
    0 4px 8px -2px rgba(0, 0, 0, 0.45),
    0 20px 40px -12px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

html[data-theme="dark"] .premium-toast::before {
  border-radius: 14px 0 0 14px;
}

.premium-toast--in {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.premium-toast--out {
  opacity: 0;
  transform: translateX(calc(100% + 0.85rem)) scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .premium-toast {
    transition-duration: 0.06s;
    transform: none;
  }

  .premium-toast--in,
  .premium-toast--out {
    transform: none;
  }
}

.premium-toast__inner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 0.6rem 1rem 1.15rem;
  min-height: 3.25rem;
}

.premium-toast__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--toast-icon-bg);
  color: var(--toast-icon-fg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] .premium-toast__icon {
  box-shadow: none;
}

.premium-toast__icon-svg {
  display: block;
}

.premium-toast__content {
  flex: 1;
  min-width: 0;
  padding-top: 0.2rem;
}

.premium-toast__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.premium-toast__message {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--text);
}

.premium-toast__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  margin: -0.2rem -0.1rem 0 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast), transform 0.15s ease;
}

.premium-toast__close:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.premium-toast__close:active {
  transform: scale(0.94);
}

/* Type accents */
.premium-toast--success {
  --toast-bar: #059669;
  border-color: rgba(5, 150, 105, 0.2);
}

.premium-toast--success .premium-toast__icon {
  --toast-icon-bg: var(--success-bg);
  --toast-icon-fg: var(--success);
}

html[data-theme="dark"] .premium-toast--success {
  border-color: rgba(52, 211, 153, 0.22);
}

.premium-toast--error {
  --toast-bar: #dc2626;
  border-color: var(--danger-border);
}

.premium-toast--error .premium-toast__icon {
  --toast-icon-bg: var(--danger-bg);
  --toast-icon-fg: var(--danger);
}

.premium-toast--warning {
  --toast-bar: #d97706;
  border-color: rgba(217, 119, 6, 0.25);
}

.premium-toast--warning .premium-toast__icon {
  --toast-icon-bg: rgba(217, 119, 6, 0.12);
  --toast-icon-fg: #b45309;
}

html[data-theme="dark"] .premium-toast--warning {
  border-color: rgba(251, 191, 36, 0.28);
}

html[data-theme="dark"] .premium-toast--warning .premium-toast__icon {
  --toast-icon-bg: rgba(251, 191, 36, 0.14);
  --toast-icon-fg: #fbbf24;
}

.premium-toast--info {
  --toast-bar: var(--accent);
  border-color: rgb(var(--accent-rgb) / 0.18);
}

.premium-toast--info .premium-toast__icon {
  --toast-icon-bg: var(--accent-muted);
  --toast-icon-fg: var(--accent);
}

@media (max-width: 540px) {
  .premium-toast-host {
    left: max(0.85rem, env(safe-area-inset-left, 0px));
    right: max(0.85rem, env(safe-area-inset-right, 0px));
    width: auto;
  }

  .premium-toast {
    transform: translateY(calc(-100% - 1.25rem)) scale(0.98);
  }

  .premium-toast--in {
    transform: translateY(0) scale(1);
  }

  .premium-toast--out {
    transform: translateY(calc(-100% - 0.85rem)) scale(0.98);
  }

  @media (prefers-reduced-motion: reduce) {
    .premium-toast--in,
    .premium-toast--out {
      transform: none;
    }
  }
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  background: var(--bg-subtle);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group textarea {
  min-height: 110px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.btn {
  padding: 0.55rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover-md);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.1rem;
  color: var(--accent);
  font-size: 0.875rem;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

.hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.45;
}

.error-list {
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  color: var(--danger);
  list-style-position: inside;
  font-size: 0.875rem;
}

.flash-inline-success {
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  color: var(--success);
}

.form-error {
  color: #fca5a5;
  font-size: 0.8125rem;
  margin-top: 0.375rem;
}

/* —— Admin dashboard —— */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.85rem;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 0.85rem 1rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.dash-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
}

.dash-card.card-blue::before {
  background: linear-gradient(180deg, #7c9eff, #4f6ed4);
}
.dash-card.card-violet::before {
  background: linear-gradient(180deg, #b794f6, #7c5cbf);
}
.dash-card.card-emerald::before {
  background: linear-gradient(180deg, #5eead4, #14b8a6);
}
.dash-card.card-amber::before {
  background: linear-gradient(180deg, #fcd34d, #d97706);
}
.dash-card.card-cyan::before {
  background: linear-gradient(180deg, #67e8f9, #0891b2);
}

.dash-card .card-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.dash-card .card-value {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

.dash-card.card-emerald .card-value {
  color: var(--success);
}

.welcome {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

.section-title:first-of-type {
  margin-top: 0;
}

.btn-view-all {
  display: inline-block;
  margin-top: 0.65rem;
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-view-all:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover-md);
}

.btn-view-all--block {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  box-sizing: border-box;
}

/* —— Premium dashboard layout (admin / distributor) —— */
.main.main--fluid {
  max-width: none;
  width: 100%;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 1200px) {
  .main.main--fluid {
    padding-left: 1.65rem;
    padding-right: 1.65rem;
  }
}

.dashboard-page {
  width: 100%;
}

.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-muted);
}

.dashboard-hero .welcome {
  margin-bottom: 0;
}

.dashboard-hero-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.dash-cards.dash-cards--kpi {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .dash-cards.dash-cards--kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .dash-cards.dash-cards--kpi {
    grid-template-columns: 1fr;
  }
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1.35rem;
  align-items: start;
  margin-top: 1.35rem;
}

@media (max-width: 1100px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

.dashboard-charts-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.dashboard-side-col {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.dash-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1.35rem;
  transition: box-shadow var(--transition-fast);
}

.dash-chart-card:hover {
  box-shadow: var(--shadow);
}

.dash-chart-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}

.dash-chart-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.dash-chart-sub {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.dash-chart-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 0.85rem;
}

.dash-chart-desc--tight {
  margin-bottom: 0.65rem;
}

.dash-chart-body {
  position: relative;
  height: 280px;
}

.dash-chart-body--donut {
  height: 260px;
  max-width: 320px;
  margin: 0 auto;
}

.dashboard-side-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.15rem 1.25rem;
}

.dashboard-side-panel .section-title {
  margin-top: 0;
}

.dashboard-quick-actions .dash-chart-title {
  margin-bottom: 0.15rem;
}

.dash-cards.dash-cards--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.dash-card.dash-card--compact {
  padding: 0.7rem 0.9rem;
}

.dash-card.dash-card--compact .card-title {
  font-size: 0.5625rem;
}

.dash-card.dash-card--compact .card-value {
  font-size: 1.05rem;
}

.dash-card.dash-card--compact-span {
  grid-column: 1 / -1;
}

.dashboard-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.distributor-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.35rem;
}

@media (max-width: 768px) {
  .distributor-charts-grid {
    grid-template-columns: 1fr;
  }

  .distributor-charts-grid .dash-chart-body--donut {
    max-width: none;
  }
}

/* —— Distributor dashboard —— */
.kpi-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
  margin-top: 1.75rem;
}

.kpi-section-title:first-of-type {
  margin-top: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
}

.stat-card.sb-1::before,
.stat-card.sv-1::before {
  background: linear-gradient(180deg, #7c9eff, #4f6ed4);
}
.stat-card.sb-2::before,
.stat-card.sv-2::before {
  background: linear-gradient(180deg, #fcd34d, #d97706);
}
.stat-card.sb-3::before,
.stat-card.sv-3::before {
  background: linear-gradient(180deg, #67e8f9, #0891b2);
}
.stat-card.sb-4::before,
.stat-card.sv-4::before {
  background: linear-gradient(180deg, #5eead4, #14b8a6);
}
.stat-card.sb-5::before {
  background: linear-gradient(180deg, #fcd34d, #b45309);
}
.stat-card.sb-6::before,
.stat-card.sv-5::before {
  background: linear-gradient(180deg, #86efac, #22c55e);
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-card.sb-4 .stat-value,
.stat-card.sb-6 .stat-value {
  color: var(--success);
}

.dash-actions {
  margin-bottom: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.recent-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-muted);
  font-size: 0.8125rem;
  margin-top: 0.85rem;
  box-shadow: var(--shadow-soft);
}

.recent-table th,
.recent-table td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.recent-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recent-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notices-section {
  margin-top: 1.75rem;
}

.notices-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.notice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 0.85rem;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-soft);
  transition: var(--transition-fast);
}

.notice-card:hover {
  border-color: var(--border);
}

.notice-card .notice-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.notice-card .notice-body {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.notice-card .notice-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.55rem;
}

.no-notices {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-muted);
  border-radius: var(--radius-sm);
}

/* —— KPI grid (admin activations) —— */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
}

.kpi-card.kpi-1::before {
  background: linear-gradient(180deg, #7c9eff, #4f6ed4);
}
.kpi-card.kpi-2::before {
  background: linear-gradient(180deg, #b794f6, #7c5cbf);
}
.kpi-card.kpi-3::before {
  background: linear-gradient(180deg, #67e8f9, #0891b2);
}
.kpi-card.kpi-4::before {
  background: linear-gradient(180deg, #5eead4, #14b8a6);
}

.kpi-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.kpi-card.kpi-4 .kpi-value {
  color: var(--success);
}

/* —— Services catalog —— */
.svc-page {
  max-width: none;
  width: 100%;
}

.svc-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.svc-nav a {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
}

.svc-nav a.svc-nav-active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  box-shadow: var(--shadow-hover-sm);
}

.svc-nav a:not(.svc-nav-active) {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  color: var(--text-muted);
}

.svc-nav a:not(.svc-nav-active):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.svc-heading {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.15rem;
  letter-spacing: 0.02em;
}

.svc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
}

@media (max-width: 1100px) {
  .svc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .svc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
}

.svc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.svc-card:hover {
  box-shadow: var(--shadow-card);
  border-color: rgb(var(--accent-rgb) / 0.35);
  transform: translateY(-4px);
}

.svc-card a {
  text-decoration: none;
  color: inherit;
}

.svc-card-img {
  width: 100%;
  aspect-ratio: 1;
  min-height: 140px;
  background: linear-gradient(145deg, #1a1a24 0%, #0e0e12 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  flex-shrink: 0;
}

.svc-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.svc-card-body {
  padding: 1rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.svc-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.45rem 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.svc-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 0.75rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.svc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.svc-price {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.svc-price span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.svc-btn-buy {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.svc-btn-buy:hover {
  box-shadow: var(--shadow-hover-sm);
  transform: translateY(-1px);
}

.svc-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-muted);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  grid-column: 1 / -1;
}

/* —— Content header / cards (activations edit etc.) —— */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-muted);
}

.content-header .breadcrumb {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.content-header .breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.content-header .breadcrumb a:hover {
  text-decoration: underline;
}

.content-header .breadcrumb .active {
  color: var(--text);
}

.content-header .actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-header.btn-outline {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-muted);
}

.btn-header.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-header.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
}

.btn-header.btn-primary:hover {
  box-shadow: var(--shadow-hover-sm);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.card-header {
  padding: 0.65rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.detail-item .label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.detail-item .value {
  color: var(--text);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.detail-table th,
.detail-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.detail-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-table .text-right {
  text-align: right;
}

.company-logo-edit {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border-muted);
}

.d-none {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-muted);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.modal-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.modal-body {
  padding: 1rem;
  font-size: 0.8125rem;
}

/* —— Wallet top-up (distributor) —— */
.wallet-topup-page {
  width: 100%;
  max-width: none;
}

.wallet-topup-header .content-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.02em;
}

.wallet-topup-header .content-header-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  max-width: 42rem;
  line-height: 1.45;
}

.wallet-topup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: start;
}

@media (min-width: 960px) {
  .wallet-topup-grid {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1.35rem;
  }
}

.wallet-topup-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wallet-topup-card-h {
  font-size: 0.9375rem;
  font-weight: 600;
}

.wallet-topup-balance-val {
  margin: 0 0 0.35rem 0;
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-hover);
  letter-spacing: -0.02em;
}

.wallet-topup-steps {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.55;
}

.wallet-topup-steps li {
  margin-bottom: 0.55rem;
}

.wallet-topup-steps li:last-child {
  margin-bottom: 0;
}

.wallet-topup-steps a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.wallet-topup-steps a:hover {
  text-decoration: underline;
}

.wallet-topup-visual-body {
  text-align: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.wallet-topup-side-img {
  width: 100%;
  max-width: 240px;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
  display: block;
  margin: 0 auto;
}

.wallet-topup-visual-caption {
  margin: 0.65rem 0 0 0;
}

.wallet-topup-form-card .card-body {
  padding-top: 1.05rem;
}

.wallet-topup-form .form-group:last-of-type {
  margin-bottom: 1rem;
}

.wallet-topup-callout {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  background: var(--accent-muted);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.wallet-topup-actions {
  margin-top: 0.25rem;
}

.wallet-topup-submit {
  min-width: 12rem;
}

@media (max-width: 959px) {
  .wallet-topup-grid {
    display: flex;
    flex-direction: column;
  }

  .wallet-topup-form-card {
    order: -1;
  }
}

.wallet-history-filters {
  margin-bottom: 1rem;
}

.wallet-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  box-shadow: var(--shadow-soft);
}

.wallet-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.wallet-table-wrap th,
.wallet-table-wrap td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.wallet-table-wrap th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wallet-table-wrap tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.wallet-amount-pos {
  color: var(--success);
  font-weight: 600;
}

.wallet-amount-neg {
  color: #fca5a5;
  font-weight: 600;
}

/* —— Visiting card editor —— */
.vc-page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 2.5rem;
}

.vc-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.35rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-muted);
  box-shadow: var(--shadow-soft);
}

.vc-page-header .vc-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.vc-page-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  letter-spacing: 0.02em;
}

.vc-page-header .breadcrumb {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.vc-page-header .breadcrumb li + li::before {
  content: "›";
  margin-right: 0.35rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.vc-page-header .breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.vc-page-header .breadcrumb a:hover {
  text-decoration: underline;
}

.vc-page-header .breadcrumb .active {
  color: var(--text-muted);
  font-weight: 500;
}

.vc-btn-show {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  box-shadow: var(--shadow-hover-sm);
  transition: var(--transition-fast);
}

.vc-btn-show:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover-lg);
}

.vc-alert {
  margin-bottom: 1rem;
  padding: 0.85rem 1.1rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.vc-alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.vc-alert-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.vc-alert ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.vc-domain-card {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid rgb(var(--accent-rgb) / 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(30, 27, 45, 0.95) 50%, rgb(var(--accent-rgb) / 0.12) 100%);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.vc-domain-card .vc-domain-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  font-weight: 600;
  font-size: 0.8125rem;
}

.vc-domain-card .vc-domain-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.vc-domain-card .vc-domain-url {
  font-size: 0.8125rem;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border-muted);
}

.vc-domain-card .vc-btn-open {
  color: var(--text);
  background: rgb(var(--accent-rgb) / 0.25);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition-fast);
  border: 1px solid rgb(var(--accent-rgb) / 0.4);
}

.vc-domain-card .vc-btn-open:hover {
  background: rgb(var(--accent-rgb) / 0.38);
}

.vc-domain-card .vc-domain-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.vc-domain-card .vc-btn-copy {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
}

.vc-domain-card .vc-btn-copy:hover {
  background: rgba(255, 255, 255, 0.12);
}

.vc-domain-available {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.3rem;
}

.vc-domain-available.yes {
  color: var(--success);
}

.vc-domain-available.no {
  color: #fca5a5;
}

.vc-domain-available.checking {
  color: var(--text-muted);
}

.vc-section {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border-muted);
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
}

.vc-section .card-header {
  font-weight: 600;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-muted);
}

.vc-section .card-header .vc-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.vc-section.vc-primary .card-header {
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.12) 0%, rgba(30, 58, 138, 0.2) 100%);
  color: #93c5fd;
}

.vc-section.vc-primary .card-header .vc-icon {
  background: rgba(59, 130, 246, 0.35);
  color: #dbeafe;
}

.vc-section.vc-success .card-header {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.12) 0%, rgba(6, 78, 59, 0.25) 100%);
  color: #6ee7b7;
}

.vc-section.vc-success .card-header .vc-icon {
  background: rgba(34, 197, 94, 0.35);
  color: #ecfdf5;
}

.vc-section.vc-info .card-header {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12) 0%, rgba(12, 74, 110, 0.25) 100%);
  color: #7dd3fc;
}

.vc-section.vc-info .card-header .vc-icon {
  background: rgba(14, 165, 233, 0.35);
  color: #e0f2fe;
}

.vc-section.vc-warning .card-header {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.12) 0%, rgba(120, 53, 15, 0.25) 100%);
  color: #fcd34d;
}

.vc-section.vc-warning .card-header .vc-icon {
  background: rgba(245, 158, 11, 0.35);
  color: #fffbeb;
}

.vc-section.vc-secondary .card-header {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.1) 0%, rgba(30, 41, 59, 0.4) 100%);
  color: #cbd5e1;
}

.vc-section.vc-secondary .card-header .vc-icon {
  background: rgba(100, 116, 139, 0.45);
  color: #f1f5f9;
}

.vc-section .card-body {
  padding: 1.1rem 1.25rem;
  font-size: 0.8125rem;
}

.vc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.1rem;
}

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

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

.vc-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.vc-form-group label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.vc-form-group input,
.vc-form-group select,
.vc-form-group textarea {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--bg-subtle);
  color: var(--text);
  transition: var(--transition-fast);
}

.vc-form-group input:focus,
.vc-form-group select:focus,
.vc-form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.vc-form-group textarea {
  min-height: 72px;
  resize: vertical;
}

.vc-form-group .hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.vc-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.85rem 0 0.4rem;
  padding-bottom: 0.25rem;
}

.vc-hr {
  margin: 0.85rem 0;
  border: none;
  border-top: 1px solid var(--border-muted);
}

.vc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-muted);
}

.vc-actions .btn,
.vc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

.vc-actions .btn-primary,
.vc-btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
}

.vc-actions .btn-primary:hover,
.vc-btn-primary:hover {
  box-shadow: var(--shadow-hover-sm);
}

.vc-actions .btn-outline,
.vc-btn-outline {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border-muted);
}

.vc-actions .btn-outline:hover,
.vc-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.vc-btn-danger {
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.vc-btn-danger:hover {
  background: rgba(239, 68, 68, 0.38);
}

.vc-btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

.vc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.vc-table th,
.vc-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.vc-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vc-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.vc-table img.vc-thumb {
  max-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border-muted);
  display: block;
}

.vc-thumb-wrap {
  position: relative;
  display: inline-block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast);
}

.vc-thumb-wrap:hover {
  transform: scale(1.02);
}

.vc-thumb-wrap .vc-del {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0.2rem 0.4rem;
  font-size: 0.6875rem;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  color: #fca5a5;
  cursor: pointer;
  font-weight: 600;
}

.vc-thumb-wrap .vc-del:hover {
  background: var(--danger-bg);
}

/* Visiting card: same icon actions as admin tables + compact overlay delete */
.vc-table .table-actions {
  gap: 0.2rem;
}

.vc-thumb-wrap > form.table-action-form {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
  z-index: 2;
}

.vc-thumb-wrap .table-action.table-action--delete {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.vc-thumb-wrap .table-action--delete .table-action__svg {
  width: 1.05rem;
  height: 1.05rem;
}

.vc-add-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
  padding: 0.85rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-muted);
}

.vc-upload-zone {
  border: 2px dashed var(--border-muted);
  border-radius: var(--radius);
  padding: 1.15rem;
  text-align: center;
  background: var(--bg-subtle);
  transition: var(--transition-fast);
  cursor: pointer;
}

.vc-upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.vc-feedback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

.vc-feedback-thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.vc-feedback-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.vc-feedback-placeholder {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.vc-thumb-del-form {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
  z-index: 2;
}

.vc-empty-photos {
  text-align: center;
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 2px dashed var(--border-muted);
}

.vc-empty-photos .vc-empty-icon {
  font-size: 1.5rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.vc-empty-photos p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.8125rem;
}

.vc-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.vc-modal-backdrop[style*="flex"] {
  display: flex !important;
}

.vc-modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 1px solid var(--border-muted);
}

/* —— Visiting card show —— */
.vc-show-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.vc-show-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.vc-show-header {
  background: linear-gradient(135deg, #1a1520 0%, #0f0e14 100%);
  border-bottom: 1px solid var(--border-muted);
  color: var(--text);
  padding: 1.35rem;
  text-align: center;
}

.vc-show-logo {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  margin: 0 auto 0.55rem;
  display: block;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
}

.vc-show-name {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}

.vc-show-designation {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.vc-show-body {
  padding: 1.35rem;
  font-size: 0.875rem;
}

.vc-show-body .vc-row {
  margin-bottom: 0.55rem;
}

.vc-show-section {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-muted);
}

.vc-show-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: var(--text);
  font-family: var(--font-display);
}

.vc-show-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

.vc-show-products .item {
  text-align: center;
}

.vc-show-products .item img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
}

.vc-show-products .item .name {
  font-size: 0.8125rem;
  margin-top: 0.4rem;
  font-weight: 500;
}

.vc-show-banners {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.vc-show-banners img {
  max-height: 80px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
}

.vc-show-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.55rem;
}

.vc-show-gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
}

.vc-show-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.vc-show-videos .item {
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
}

.vc-show-videos .item video {
  width: 100%;
  display: block;
}

.vc-show-videos .item .thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: var(--bg);
}

.vc-show-empty {
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 0.55rem 0;
}

.vc-show-actions {
  margin-top: 1.1rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.vc-show-actions .btn {
  padding: 0.55rem 1.1rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
}

.vc-show-actions .btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
}

.vc-show-actions .btn-outline {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border-muted);
}

@media print {
  .vc-show-actions {
    display: none !important;
  }
}

/* —— Premium messaging (service order thread) —— */
.sod-page {
  width: 100%;
  max-width: 100%;
  margin: -1.35rem -1.5rem -2rem;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 4.5rem);
  min-height: 320px;
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 45%, var(--bg-subtle) 100%);
  overflow: hidden;
  position: relative;
  border-radius: 0;
}

html[data-theme="dark"] .sod-page {
  background: linear-gradient(180deg, #1a1a28 0%, #15151f 40%, #12121c 100%);
}

.sod-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.35);
  z-index: 9999;
}

.sod-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-muted);
  color: var(--text);
  gap: 0.85rem;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] .sod-header {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sod-header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text);
  text-decoration: none;
  border-radius: 50%;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.sod-header-back:hover {
  background: var(--nav-hover-bg);
  color: var(--accent);
}

.sod-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sod-header-info {
  flex: 1;
  min-width: 0;
}

.sod-header-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sod-header-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sod-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sod-header-right a {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.sod-header-right a:hover {
  background: var(--accent-muted);
}

.sod-badge {
  font-size: 0.7rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-muted);
  border: 1px solid var(--border);
  font-weight: 700;
  text-transform: capitalize;
  color: var(--accent-hover);
}

.sod-work-banner {
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.12) 0%, rgba(6, 78, 59, 0.2) 100%);
  border-bottom: 1px solid var(--success-border);
  padding: 0.55rem 1.1rem;
  color: var(--success);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sod-work-banner strong {
  flex: 1;
}

.sod-ticket-banner {
  flex-shrink: 0;
  padding: 0.55rem 1.1rem;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sod-ticket-banner--closed {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.14) 0%, rgba(100, 116, 139, 0.12) 100%);
  border-bottom: 1px solid var(--border-muted);
  color: var(--text-muted);
}

.sod-ticket-banner--closed strong {
  flex: 1;
  color: var(--text);
  font-weight: 600;
}

html[data-theme="dark"] .sod-ticket-banner--closed {
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.1) 0%, rgba(30, 30, 46, 0.9) 100%);
  border-bottom-color: rgba(129, 140, 248, 0.15);
}

.sod-header-right a[data-modal-open] {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.sod-header-right a[data-modal-open]:hover {
  background: var(--accent-muted);
}

.sod-input-form--text-only {
  width: 100%;
}

.sod-input-form--text-only textarea {
  flex: 1;
  min-width: 0;
}

.sod-page--ticket .sod-header-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sod-chat-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.65rem 0.9rem;
  /* background: color-mix(in srgb, var(--bg-subtle) 88%, var(--accent) 12%); */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%234f46e5' fill-opacity='0.06'%3E%3Cpath d='M10 12H6v4l4-4zm4 4h4v-4l-4 4zM38 12h-4v4l4-4zm4 4h4v-4l-4 4zM10 38H6v4l4-4zm4 4h4v-4l-4 4zM38 38h-4v4l4-4zm4 4h4v-4l-4 4z'/%3E%3C/g%3E%3C/svg%3E");
}

@supports not (background: color-mix(in srgb, white, black)) {
  .sod-chat-container {
    background: var(--bg-subtle);
  }
}

html[data-theme="dark"] .sod-chat-container {
  background: #1c1c2a;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23818cf8' fill-opacity='0.055'%3E%3Cpath d='M10 12H6v4l4-4zm4 4h4v-4l-4 4zM38 12h-4v4l4-4zm4 4h4v-4l-4 4zM10 38H6v4l4-4zm4 4h4v-4l-4 4zM38 38h-4v4l4-4zm4 4h4v-4l-4 4z'/%3E%3C/g%3E%3C/svg%3E");
}

.sod-chat-container::after {
  content: "";
  display: table;
  clear: both;
}

.sod-date-sep {
  clear: both;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.85rem 0;
}

.sod-date-sep::before,
.sod-date-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-muted);
}

.sod-date-sep span {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-muted);
}

.sod-bubble {
  max-width: 72%;
  margin-bottom: 0.35rem;
  clear: both;
}

.sod-bubble.distributor {
  float: right;
}

.sod-bubble.admin {
  float: left;
}

.sod-bubble-inner {
  padding: 0.45rem 0.65rem 0.5rem 0.75rem;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-muted);
}

.sod-bubble.distributor .sod-bubble-inner {
  background: linear-gradient(145deg, rgb(var(--accent-rgb) / 0.22) 0%, rgb(var(--accent-rgb) / 0.08) 100%);
  border-top-right-radius: 4px;
  border-color: rgb(var(--accent-rgb) / 0.35);
}

.sod-bubble.admin .sod-bubble-inner {
  background: linear-gradient(145deg, var(--bg-card) 0%, color-mix(in srgb, var(--bg-card) 92%, var(--accent) 8%) 100%);
  border-top-left-radius: 4px;
}

@supports not (background: color-mix(in srgb, white, black)) {
  .sod-bubble.admin .sod-bubble-inner {
    background: var(--bg-card);
  }
}

html[data-theme="dark"] .sod-bubble.admin .sod-bubble-inner {
  background: linear-gradient(145deg, #252536 0%, #1e1e2e 100%);
  border-color: rgba(129, 140, 248, 0.22);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.sod-bubble-text {
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.sod-bubble-meta {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.sod-bubble-att {
  margin-top: 0.4rem;
}

.sod-bubble-att img {
  max-width: 100%;
  max-height: 260px;
  border-radius: var(--radius-sm);
  display: block;
}

.sod-bubble-att a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.8125rem;
  text-decoration: none;
  margin-top: 0.35rem;
  border: 1px solid var(--border-muted);
}

.sod-bubble-att a:hover {
  border-color: var(--accent);
}

.sod-bubble-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.sod-bubble.distributor .sod-bubble-footer {
  justify-content: flex-end;
}

.sod-bubble.admin .sod-bubble-footer {
  justify-content: flex-start;
}

.sod-bubble-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.sod-bubble-ticks {
  font-size: 0.75rem;
  color: var(--accent);
}

.sod-bubble-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sod-bubble.distributor .sod-bubble-label {
  text-align: right;
}

.sod-bubble.admin .sod-bubble-label {
  text-align: left;
}

.sod-chat-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  clear: both;
}

.sod-input-bar {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  padding: 0.55rem 0.75rem;
  background: color-mix(in srgb, var(--bg-card) 94%, var(--accent-muted));
  border-top: 1px solid var(--border-muted);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.05);
}

@supports not (background: color-mix(in srgb, white, black)) {
  .sod-input-bar {
    background: var(--bg-card);
  }
}

html[data-theme="dark"] .sod-input-bar {
  background: rgba(30, 30, 46, 0.92);
  backdrop-filter: blur(12px);
  border-top-color: rgba(129, 140, 248, 0.12);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.22), 0 -1px 0 rgba(129, 140, 248, 0.08);
}

.sod-input-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sod-btn-attach {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.sod-btn-attach:hover {
  background: var(--nav-hover-bg);
  color: var(--accent);
}

.sod-input-bar textarea {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  font-size: 0.9375rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  background: var(--bg-subtle);
  color: var(--text);
  font-family: inherit;
}

.sod-input-bar textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.sod-input-bar textarea::placeholder {
  color: var(--text-muted);
}

.sod-file-hidden {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
}

.sod-btn-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-hover-sm);
}

.sod-btn-send:hover {
  transform: scale(1.05);
}

.sod-btn-send:active {
  transform: scale(0.96);
}

.sod-file-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: color-mix(in srgb, var(--bg-subtle) 75%, var(--accent-muted));
  flex-direction: column;
}

@supports not (background: color-mix(in srgb, white, black)) {
  .sod-file-overlay {
    background: var(--bg-subtle);
  }
}

html[data-theme="dark"] .sod-file-overlay {
  background: linear-gradient(165deg, #222232 0%, #1a1a28 50%, #161622 100%);
}

.sod-file-overlay.sod-file-open {
  display: flex;
}

.sod-file-header {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-muted);
  gap: 0.85rem;
  flex-shrink: 0;
  background: var(--bg-card);
}

.sod-file-close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.sod-file-close:hover {
  background: var(--nav-hover-bg);
  color: var(--text);
}

.sod-file-filename {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sod-file-preview-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--bg-subtle) 85%, var(--accent) 15%);
}

@supports not (background: color-mix(in srgb, white, black)) {
  .sod-file-preview-wrap {
    background: var(--bg-subtle);
  }
}

html[data-theme="dark"] .sod-file-preview-wrap {
  background: rgba(20, 20, 32, 0.65);
}

.sod-file-preview-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
}

.sod-file-nopreview {
  text-align: center;
  color: var(--text-muted);
}

.sod-file-nopreview .sod-file-docicon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.sod-file-nopreview .sod-file-nopreview-text {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.sod-file-nopreview .sod-file-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.sod-file-footer {
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-muted);
  flex-shrink: 0;
}

.sod-file-footer .sod-file-msg-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.sod-file-footer textarea {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 0.9375rem;
  resize: none;
  min-height: 44px;
  font-family: inherit;
  color: var(--text);
}

.sod-file-footer textarea::placeholder {
  color: var(--text-muted);
}

.sod-file-footer .sod-file-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.sod-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  background: var(--accent-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-hover);
  margin-right: 0.25rem;
}

.sod-file-chip span {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sod-file-addmore {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sod-file-addmore:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sod-file-send-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: 50%;
  font-size: 1.35rem;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-hover-sm);
}

.sod-file-send-btn:hover {
  transform: scale(1.05);
}

/* —— Auth pages —— */
body.auth-premium {
  font-family: var(--font-ui);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  background-image: var(--auth-bg-image);
  color: var(--text);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--auth-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.5rem 2.25rem;
  border: 1px solid var(--border-muted);
  animation: auth-in 0.6s var(--ease-out) both;
}

html[data-theme="dark"] .auth-card {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@keyframes auth-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.03em;
}

.auth-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

.auth-card .form-group {
  margin-bottom: 1.25rem;
}

.auth-card .form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.auth-card .form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition-fast);
}

.auth-card .form-group input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.auth-card .form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* Password field + visibility toggle (register, etc.) */
.auth-card .premium-auth-password-field {
  position: relative;
  display: block;
}

.auth-card .premium-auth-password-field input {
  padding-right: 3.1rem;
  min-height: 2.85rem;
}

.auth-card .premium-auth-password-toggle {
  position: absolute;
  top: 0;
  right: 0.2rem;
  bottom: 0;
  margin: auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  max-height: 100%;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.auth-card .premium-auth-password-toggle:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.auth-card .premium-auth-password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-card .premium-auth-password-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.auth-card .premium-auth-password-toggle svg.is-hidden {
  display: none;
}

/* Distributor register: two-step wizard */
.auth-card .premium-auth-step-hint {
  margin: 0 0 1.15rem 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
}

html[data-theme="dark"] .auth-card .premium-auth-step-hint {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Register form: always column layout (avoids fields/actions lining up in one row) */
.auth-card #distributor-register-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.auth-card .premium-auth-register-step {
  display: none;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 0;
}

.auth-card .premium-auth-register-step.is-active {
  display: flex;
}

.auth-card .premium-auth-register-step .form-group {
  width: 100%;
  max-width: 100%;
}

.auth-card .premium-auth-register-step .premium-auth-password-field {
  width: 100%;
  max-width: 100%;
}

.auth-card .premium-auth-register-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.15rem;
}

@media (min-width: 420px) {
  .auth-card .premium-auth-register-actions {
    flex-direction: row;
    align-items: stretch;
    gap: 0.75rem;
  }

  .auth-card .premium-auth-register-actions .btn-login {
    flex: 1 1 0;
    min-width: 0;
    margin-bottom: 0;
  }

  .auth-card .premium-auth-register-actions .btn-login--secondary {
    flex: 0 1 38%;
    max-width: 11rem;
  }
}

.auth-card .btn-login.btn-login--secondary {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border-muted);
  margin-bottom: 0.75rem;
}

.auth-card .premium-auth-register-actions .btn-login.btn-login--secondary {
  margin-bottom: 0;
}

.auth-card .btn-login.btn-login--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
  transform: none;
}

html[data-theme="dark"] .auth-card .btn-login.btn-login--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.auth-card .remember-row {
  margin-bottom: 1.5rem;
}

.auth-card .remember {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 0;
}

.auth-card .remember input {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--accent);
}

.auth-card .btn-login {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.auth-card .btn-login:hover {
  box-shadow: var(--shadow-hover-lg);
  transform: translateY(-1px);
}

.auth-card .alert-error {
  font-size: 0.875rem;
  color: #fecaca;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.auth-card .alert-success {
  font-size: 0.875rem;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

/* —— Premium auth login (distributor + admin): poster frame + animated backdrop —— */
body.auth-premium.premium-auth-page {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 3vw, 1.75rem);
  background: #05040a;
  background-image: none;
}

.premium-auth-root {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

html[data-theme="light"] body.auth-premium.premium-auth-page,
html:not([data-theme]) body.auth-premium.premium-auth-page {
  background: #ece9f7;
}

html[data-theme="dark"] body.auth-premium.premium-auth-page {
  background: #05040a;
}

.premium-auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #05040a;
  background-image:
    radial-gradient(ellipse 115% 90% at 50% -12%, rgb(99 102 241 / 0.32), transparent 55%),
    radial-gradient(ellipse 80% 58% at 108% 88%, rgb(147 51 234 / 0.22), transparent 50%),
    radial-gradient(ellipse 60% 50% at -8% 72%, rgb(56 189 248 / 0.1), transparent 52%),
    linear-gradient(168deg, #100b1c 0%, #080612 42%, #05040a 100%);
}

html[data-theme="light"] .premium-auth-bg,
html:not([data-theme]) .premium-auth-bg {
  background-color: #ece9f7;
  background-image:
    radial-gradient(ellipse 105% 80% at 50% -14%, rgb(199 210 254 / 0.95), transparent 58%),
    radial-gradient(ellipse 70% 50% at 102% 102%, rgb(233 213 255 / 0.75), transparent 52%),
    radial-gradient(ellipse 55% 45% at -5% 85%, rgb(224 231 255 / 0.85), transparent 50%),
    linear-gradient(172deg, #fdfdff 0%, #f4f1ff 48%, #ebe7f7 100%);
}

html[data-theme="dark"] .premium-auth-bg {
  background-color: #05040a;
  background-image:
    radial-gradient(ellipse 115% 90% at 50% -12%, rgb(99 102 241 / 0.34), transparent 55%),
    radial-gradient(ellipse 80% 58% at 108% 88%, rgb(147 51 234 / 0.24), transparent 50%),
    radial-gradient(ellipse 60% 50% at -8% 72%, rgb(56 189 248 / 0.11), transparent 52%),
    linear-gradient(168deg, #100b1c 0%, #080612 42%, #05040a 100%);
}

.premium-auth-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: premium-auth-float 22s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .premium-auth-bg-blob {
    animation: none;
  }
}

.premium-auth-bg-blob--1 {
  width: min(72vw, 520px);
  height: min(72vw, 520px);
  top: -12%;
  left: -8%;
  background: radial-gradient(circle at 30% 30%, rgb(129 140 248 / 0.55), rgb(79 70 229 / 0.15) 55%, transparent 70%);
  animation-delay: 0s;
}

.premium-auth-bg-blob--2 {
  width: min(85vw, 640px);
  height: min(85vw, 640px);
  bottom: -18%;
  right: -15%;
  background: radial-gradient(circle at 60% 50%, rgb(167 139 250 / 0.45), rgb(99 102 241 / 0.12) 50%, transparent 68%);
  animation-delay: -7s;
}

.premium-auth-bg-blob--3 {
  width: min(50vw, 380px);
  height: min(50vw, 380px);
  top: 34%;
  left: 50%;
  margin-left: calc(min(50vw, 380px) / -2);
  background: radial-gradient(circle, rgb(34 211 238 / 0.18), transparent 62%);
  opacity: 0.4;
  animation: premium-auth-pulse-blob 18s ease-in-out infinite;
  animation-delay: -6s;
}

@media (prefers-reduced-motion: reduce) {
  .premium-auth-bg-blob--3 {
    animation: none;
  }
}

@keyframes premium-auth-pulse-blob {
  0%,
  100% {
    opacity: 0.32;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.06);
  }
}

html[data-theme="light"] .premium-auth-bg-blob--1,
html:not([data-theme]) .premium-auth-bg-blob--1 {
  background: radial-gradient(circle at 30% 30%, rgb(99 102 241 / 0.35), rgb(199 210 254 / 0.25) 50%, transparent 72%);
  opacity: 0.85;
}

html[data-theme="light"] .premium-auth-bg-blob--2,
html:not([data-theme]) .premium-auth-bg-blob--2 {
  background: radial-gradient(circle at 55% 45%, rgb(192 132 252 / 0.28), rgb(224 231 255 / 0.4) 55%, transparent 70%);
  opacity: 0.75;
}

html[data-theme="light"] .premium-auth-bg-blob--3,
html:not([data-theme]) .premium-auth-bg-blob--3 {
  background: radial-gradient(circle, rgb(14 165 233 / 0.12), transparent 65%);
  opacity: 0.55;
}

@keyframes premium-auth-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(3%, -2%) scale(1.04);
  }
  50% {
    transform: translate(-2%, 3%) scale(0.98);
  }
  75% {
    transform: translate(-3%, -1%) scale(1.02);
  }
}

.premium-auth-bg-grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgb(var(--accent-rgb) / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--accent-rgb) / 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 68% 62% at 50% 48%, black 0%, transparent 78%);
  animation: premium-auth-grid-drift 80s linear infinite;
  opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
  .premium-auth-bg-grid {
    animation: none;
  }
}

@keyframes premium-auth-grid-drift {
  from {
    transform: translate(0, 0) rotate(0deg);
  }
  to {
    transform: translate(-52px, -52px) rotate(0.5deg);
  }
}

html[data-theme="light"] .premium-auth-bg-grid,
html:not([data-theme]) .premium-auth-bg-grid {
  opacity: 0.65;
  background-image:
    linear-gradient(rgb(79 70 229 / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgb(79 70 229 / 0.06) 1px, transparent 1px);
}

.premium-auth-bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 88% 76% at 50% 46%, transparent 42%, rgb(0 0 0 / 0.42) 100%);
  opacity: 0.88;
}

html[data-theme="light"] .premium-auth-bg-vignette,
html:not([data-theme]) .premium-auth-bg-vignette {
  background: radial-gradient(ellipse 92% 80% at 50% 44%, transparent 48%, rgb(15 23 42 / 0.07) 100%);
  opacity: 1;
}

.premium-auth-scroll {
  position: absolute;
  top: 50%;
  width: clamp(36px, 5.5vw, 56px);
  height: 118%;
  transform: translateY(-50%);
  border-radius: 45% 45% 48% 48% / 3% 3% 97% 97%;
  background: linear-gradient(
    90deg,
    rgb(255 255 255 / 0.04) 0%,
    rgb(255 255 255 / 0.14) 22%,
    rgb(0 0 0 / 0.25) 48%,
    rgb(255 255 255 / 0.08) 78%,
    rgb(0 0 0 / 0.15) 100%
  );
  box-shadow:
    inset 0 0 20px rgb(255 255 255 / 0.06),
    0 0 40px rgb(0 0 0 / 0.35);
  opacity: 0.22;
}

html[data-theme="light"] .premium-auth-scroll,
html:not([data-theme]) .premium-auth-scroll {
  background: linear-gradient(
    90deg,
    rgb(255 255 255 / 0.9) 0%,
    rgb(226 232 240 / 0.95) 35%,
    rgb(148 163 184 / 0.5) 50%,
    rgb(241 245 249 / 0.9) 72%,
    rgb(203 213 225 / 0.85) 100%
  );
  box-shadow:
    inset 0 0 12px rgb(255 255 255 / 0.8),
    0 12px 32px rgb(15 23 42 / 0.08);
  opacity: 0.35;
}

.premium-auth-scroll--left {
  left: clamp(0.25rem, 2vw, 1.25rem);
}

.premium-auth-scroll--right {
  right: clamp(0.25rem, 2vw, 1.25rem);
  transform: translateY(-50%) scaleX(-1);
}

.premium-auth-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  animation: premium-auth-enter 0.85s var(--ease-out) both;
}

@keyframes premium-auth-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .premium-auth-content {
    animation: none;
  }
}

.premium-auth-poster {
  position: relative;
  border-radius: calc(var(--radius-lg) + 6px);
  padding: 0 10px;
  filter: drop-shadow(0 28px 48px rgb(0 0 0 / 0.45));
}

html[data-theme="light"] .premium-auth-poster,
html:not([data-theme]) .premium-auth-poster {
  filter: drop-shadow(0 24px 40px rgb(79 70 229 / 0.12)) drop-shadow(0 8px 24px rgb(15 23 42 / 0.08));
}

.premium-auth-poster-roll {
  height: 14px;
  border-radius: 999px;
  margin: 0 12px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.22) 0%, rgb(0 0 0 / 0.35) 42%, rgb(255 255 255 / 0.08) 100%);
  box-shadow:
    0 2px 0 rgb(255 255 255 / 0.06) inset,
    0 4px 14px rgb(0 0 0 / 0.4);
}

html[data-theme="light"] .premium-auth-poster-roll,
html:not([data-theme]) .premium-auth-poster-roll {
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 38%, #e2e8f0 62%, #f1f5f9 100%);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.95) inset,
    0 6px 16px rgb(15 23 42 / 0.1);
}

.premium-auth-poster-roll--top {
  margin-bottom: -7px;
  position: relative;
  z-index: 2;
}

.premium-auth-poster-roll--bottom {
  margin-top: -7px;
  position: relative;
  z-index: 2;
}

.premium-auth-poster-inner.auth-card {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 2.15rem 2rem 2.5rem;
  border-radius: var(--radius-lg);
  animation: none;
  border: 1px solid rgb(255 255 255 / 0.1);
  background:
    linear-gradient(165deg, rgb(255 255 255 / 0.08) 0%, transparent 42%),
    linear-gradient(180deg, rgb(22 20 35 / 0.92) 0%, rgb(15 13 24 / 0.96) 100%);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.05) inset,
    0 1px 0 rgb(255 255 255 / 0.06) inset;
}

html[data-theme="light"] .premium-auth-poster-inner.auth-card,
html:not([data-theme]) .premium-auth-poster-inner.auth-card {
  border: 1px solid rgb(79 70 229 / 0.12);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.98) 0%, rgb(252 251 255) 48%, rgb(248 246 255) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.8) inset,
    0 1px 0 rgb(255 255 255 / 0.95) inset;
}

.premium-auth-crest {
  display: flex;
  justify-content: center;
  margin: 0 0 0.35rem 0;
  color: var(--accent);
  opacity: 0.85;
}

.premium-auth-crest:has(img) {
  opacity: 1;
}

.premium-auth-brand.auth-brand {
  margin-bottom: 1.65rem;
  margin-top: 0;
  padding-top: 0.15rem;
  text-align: center;
}

.premium-auth-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem 0;
  opacity: 0.95;
}

.premium-auth-brand h1 {
  font-size: clamp(1.65rem, 4.5vw, 2rem);
  letter-spacing: 0.02em;
}

.premium-auth-brand p {
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

html[data-theme="light"] .premium-auth-poster-inner.auth-card .form-group input,
html:not([data-theme]) .premium-auth-poster-inner.auth-card .form-group input {
  background: rgb(255 255 255 / 0.92);
  border-color: rgb(79 70 229 / 0.14);
}

.premium-auth-poster-inner.auth-card .alert-error.premium-auth-alert,
.premium-auth-poster-inner .alert-error {
  color: #fecaca;
}

html[data-theme="light"] .premium-auth-poster-inner.auth-card .alert-error,
html:not([data-theme]) .premium-auth-poster-inner.auth-card .alert-error {
  color: #991b1b;
  background: rgba(254, 226, 226, 0.97);
  border-color: rgba(185, 28, 28, 0.32);
}

.premium-auth-switch {
  margin: 1.5rem 0 0 0;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgb(255 255 255 / 0.55);
}

.premium-auth-switch a {
  font-weight: 600;
  color: rgb(199 210 254);
  text-decoration: none;
  margin-left: 0.25rem;
}

.premium-auth-switch a:hover {
  text-decoration: underline;
  color: rgb(224 231 255);
}

html[data-theme="light"] .premium-auth-switch,
html:not([data-theme]) .premium-auth-switch {
  color: rgb(71 85 105 / 0.9);
}

html[data-theme="light"] .premium-auth-switch a,
html:not([data-theme]) .premium-auth-switch a {
  color: rgb(79 70 229);
}

html[data-theme="light"] .premium-auth-switch a:hover,
html:not([data-theme]) .premium-auth-switch a:hover {
  color: rgb(67 56 202);
}

.premium-auth-footnote {
  text-align: center;
  font-size: 0.75rem;
  color: rgb(255 255 255 / 0.42);
  margin: 1.35rem 0 0 0;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

html[data-theme="light"] .premium-auth-footnote,
html:not([data-theme]) .premium-auth-footnote {
  color: rgb(71 85 105 / 0.75);
}

/* —— Tickets, notices, misc —— */
.ticket-thread-heading {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.ticket-thread {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}

.ticket-thread.ticket-thread--chat {
  padding: 0.75rem 0.85rem 1rem;
  background: var(--bg-subtle);
}

.ticket-conversation-block {
  margin-top: 0.25rem;
}

.ticket-conversation-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: -0.15rem 0 0.65rem 0;
  line-height: 1.4;
}

.ticket-chat {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 2.5rem;
}

.ticket-chat-row {
  display: flex;
  width: 100%;
}

.ticket-chat-row--support {
  justify-content: flex-start;
}

.ticket-chat-row--me {
  justify-content: flex-end;
}

.ticket-chat-bubble {
  max-width: min(88%, 26rem);
  padding: 0.65rem 0.85rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid var(--border-muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ticket-chat-row--support .ticket-chat-bubble,
.ticket-chat-row--customer .ticket-chat-bubble {
  border-bottom-left-radius: 0.35rem;
  background: var(--bg-card);
  border-color: var(--border-muted);
  border-left: 3px solid rgba(96, 165, 250, 0.65);
}

html[data-theme="dark"] .ticket-chat-row--support .ticket-chat-bubble,
html[data-theme="dark"] .ticket-chat-row--customer .ticket-chat-bubble {
  border-left-color: rgba(125, 180, 255, 0.75);
  background: rgba(15, 23, 42, 0.65);
}

/* Admin ticket view: distributor / customer on the left (warm accent) */
.ticket-chat-row--customer .ticket-chat-bubble {
  border-left-color: rgba(217, 119, 6, 0.75);
}

html[data-theme="dark"] .ticket-chat-row--customer .ticket-chat-bubble {
  border-left-color: rgba(251, 191, 36, 0.85);
  background: rgba(15, 23, 42, 0.72);
}

.ticket-chat-row--customer .ticket-chat-bubble-name {
  color: rgba(180, 83, 9, 0.95);
}

html[data-theme="dark"] .ticket-chat-row--customer .ticket-chat-bubble-name {
  color: rgba(252, 211, 77, 0.95);
}

.ticket-chat-row--me .ticket-chat-bubble {
  border-bottom-right-radius: 0.35rem;
  background: linear-gradient(145deg, var(--accent-muted) 0%, var(--bg-card) 100%);
  border-color: var(--accent);
  opacity: 1;
}

html[data-theme="dark"] .ticket-chat-row--me .ticket-chat-bubble {
  background: linear-gradient(145deg, var(--accent-muted) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: var(--nav-active-border);
}

.ticket-chat-bubble-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.ticket-chat-bubble-name {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ticket-chat-row--me .ticket-chat-bubble-name {
  color: var(--accent);
}

.admin-ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.admin-ticket-meta-grid .ticket-card--wide {
  grid-column: 1 / -1;
}

.admin-ticket-conversation .ticket-thread-heading {
  margin-top: 0.15rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ticket-chat-bubble-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ticket-chat-bubble-text {
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.ticket-chat-empty {
  margin: 0;
  padding: 1rem 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
}

.ticket-reply-card {
  margin-top: 1rem;
}

.ticket-reply-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: inherit;
}

.ticket-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.notice-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.profile-form-card {
  max-width: 520px;
}

/* —— Distributor profile —— */
.dist-profile-page {
  width: 100%;
  max-width: none;
}

.dist-profile-header .content-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.02em;
}

.dist-profile-header .content-header-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  max-width: 40rem;
  line-height: 1.45;
}

.dist-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: start;
}

@media (min-width: 960px) {
  .dist-profile-grid {
    grid-template-columns: 1.12fr 0.88fr;
    gap: 1.25rem;
  }
}

.dist-profile-card .card-body {
  padding-top: 1.05rem;
}

.dist-profile-card-head-text {
  font-weight: 600;
  font-size: 0.9375rem;
}

.dist-profile-form-section {
  margin-bottom: 1.35rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border-muted);
}

.dist-profile-form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.dist-profile-form-section-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 0.85rem 0;
}

.dist-profile-field-row {
  display: grid;
  gap: 0 1rem;
}

.dist-profile-field-row--2 {
  grid-template-columns: 1fr;
}

@media (min-width: 540px) {
  .dist-profile-field-row--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.dist-profile-field-row .form-group {
  margin-bottom: 1.1rem;
}

.dist-profile-form-actions {
  margin-top: 1.1rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--border-muted);
}

.dist-profile-card--password .dist-profile-form-actions {
  margin-top: 0.85rem;
}

.dist-profile-password-intro {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.input-readonly {
  opacity: 0.88;
  cursor: text;
  background: var(--bg-card) !important;
  border-style: dashed;
}

html[data-theme="dark"] .input-readonly {
  opacity: 0.94;
}

.dist-profile-meta-foot {
  margin: 1.35rem 0 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.label-req {
  color: var(--accent);
  font-weight: 700;
}

.label-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: -0.15rem 0 0.4rem 0;
  line-height: 1.35;
}

.dist-profile-header-actions {
  align-items: center;
}

.dist-profile-hero {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-muted);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.dist-profile-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.15rem 1.35rem;
  flex-wrap: wrap;
}

.dist-profile-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--accent-muted) 0%, var(--accent) 100%);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--accent-muted);
}

.dist-profile-hero-text {
  flex: 1;
  min-width: 0;
}

.dist-profile-hero-name {
  margin: 0 0 0.2rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.dist-profile-hero-email {
  margin: 0 0 0.15rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  word-break: break-all;
}

.dist-profile-hero-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dist-profile-show-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: start;
}

@media (min-width: 900px) {
  .dist-profile-show-grid {
    grid-template-columns: 1fr minmax(15rem, 17.5rem);
    gap: 1.25rem;
  }
}

.dist-profile-show-body {
  padding-top: 1rem;
}

.dist-profile-show-section {
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-muted);
}

.dist-profile-show-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.dist-profile-dl {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9rem) 1fr;
  gap: 0.5rem 1.15rem;
  align-items: baseline;
  margin: 0;
  font-size: 0.875rem;
}

.dist-profile-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
}

.dist-profile-dl dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
  line-height: 1.45;
}

.dist-profile-value-block {
  white-space: pre-wrap;
}

.dist-profile-empty {
  color: var(--text-muted);
}

.dist-profile-security-card .card-body {
  padding-top: 1rem;
}

.dist-profile-security-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.dist-profile-security-link {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  text-decoration: none;
}

.dist-profile-show-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.dist-profile-show-hint a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.dist-profile-show-hint a:hover {
  text-decoration: underline;
}

.dist-profile-back-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.8125rem;
}

.dist-profile-back-link:hover {
  text-decoration: underline;
}

#dist-profile-security {
  scroll-margin-top: 5.5rem;
}

.text-muted-block {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.ticket-actions {
  margin-bottom: 1rem;
}

.tickets-page-header .content-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.02em;
}

.tickets-page-header .content-header-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  max-width: 42rem;
  line-height: 1.45;
}

.tickets-empty-cell {
  padding: 2.5rem 1.5rem !important;
  text-align: center;
  vertical-align: middle;
}

.tickets-empty {
  max-width: 22rem;
  margin: 0 auto;
}

.tickets-empty-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem 0;
  color: var(--text);
}

.tickets-empty-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.btn-sm.btn-danger {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fecaca !important;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.btn-sm.btn-danger:hover {
  background: rgba(239, 68, 68, 0.38) !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.btn-sm.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent) !important;
}

.stat-card.sc-1::before {
  background: linear-gradient(180deg, #7c9eff, #4f6ed4);
}
.stat-card.sc-2::before {
  background: linear-gradient(180deg, #b794f6, #7c5cbf);
}
.stat-card.sc-3::before {
  background: linear-gradient(180deg, #67e8f9, #0891b2);
}
.stat-card.sc-4::before {
  background: linear-gradient(180deg, #5eead4, #14b8a6);
}
.stat-card.sc-5::before {
  background: linear-gradient(180deg, #fcd34d, #d97706);
}
.stat-card.sc-6::before {
  background: linear-gradient(180deg, #fb7185, #e11d48);
}

.stat-card.sc-4 .stat-value,
.stat-card.sc-6 .stat-value {
  color: var(--success);
}

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
  max-width: 560px;
  box-shadow: var(--shadow-soft);
}

.profile-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.profile-section label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.profile-section input,
.profile-section select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--bg-subtle);
  color: var(--text);
}

.profile-section input:focus,
.profile-section select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.profile-section input:disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  opacity: 0.9;
  cursor: not-allowed;
}

.profile-section small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-section .field {
  margin-bottom: 1rem;
}

.profile-section .field:last-child {
  margin-bottom: 0;
}

.profile-section button {
  padding: 0.55rem 1.25rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: var(--transition-fast);
}

.profile-section button:hover {
  box-shadow: var(--shadow-hover-md);
}

.err {
  font-size: 0.75rem;
  color: #fca5a5;
  margin-top: 0.25rem;
}

div.pagination > nav.pagination-wrap {
  margin-top: 0;
}

div.pagination {
  margin-top: 1rem;
}

/* —— Sales activation list / create / dashboard —— */
.sa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.sa-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.order-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.order-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

/* —— Tickets detail (admin / distributor) —— */
.ticket-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}

.ticket-card h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ticket-card .value {
  font-size: 0.9375rem;
  color: var(--text);
}

.ticket-card .desc {
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-list {
  margin: 1rem 0;
}

.msg-item {
  padding: 0.75rem 1rem;
  margin-bottom: 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
}

.msg-item.distributor {
  background: var(--bg-subtle);
}

.msg-item.admin {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.28);
}

.msg-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.msg-body {
  font-size: 0.8125rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.reply-form {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-top: 1rem;
}

.reply-form textarea {
  width: 100%;
  min-height: 90px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  resize: vertical;
  background: var(--bg-subtle);
  color: var(--text);
}

.reply-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.reply-form button {
  margin-top: 0.55rem;
  padding: 0.45rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.reply-form button:hover {
  box-shadow: var(--shadow-hover-sm);
}

.status-form {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}

.status-form select {
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  background: var(--bg-subtle);
  color: var(--text);
}

.status-form button {
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-back {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.btn-back:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.body-preview {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

/* —— Ticket create form —— */
.ticket-form {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.35rem;
  max-width: 560px;
  box-shadow: var(--shadow-soft);
}

.ticket-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.ticket-form input,
.ticket-form textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--bg-subtle);
  color: var(--text);
}

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

.ticket-form .field {
  margin-bottom: 1rem;
}

.ticket-form button {
  padding: 0.55rem 1.25rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.ticket-form button:hover {
  box-shadow: var(--shadow-hover-md);
}

/* —— Wallet history —— */
.wallet-actions {
  margin-bottom: 1rem;
}

/* Distributor wallet history page */
.wallet-history-page {
  width: 100%;
  max-width: none;
}

.wallet-history-header .content-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.02em;
}

.wallet-history-header .content-header-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  max-width: 42rem;
  line-height: 1.45;
}

.wallet-history-balance-card {
  margin-bottom: 1.15rem;
  border: 1px solid var(--border-muted);
  box-shadow: var(--shadow-soft);
  padding: 0;
  overflow: hidden;
}

.wallet-history-balance-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
  border-radius: var(--radius);
}

.wallet-history-balance-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.wallet-history-balance-val {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-hover);
  letter-spacing: -0.02em;
}

.wallet-history-balance-cta {
  flex-shrink: 0;
}

.wallet-history-filters-card {
  margin-bottom: 1.15rem;
}

.wallet-history-card-h {
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wallet-history-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.wallet-history-filters-body {
  padding-top: 0.85rem;
}

.wallet-history-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.85rem 1rem;
  align-items: end;
}

.wallet-history-filter-form .form-group {
  margin-bottom: 0;
}

.wallet-history-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.wallet-history-clear {
  text-align: center;
}

.wallet-history-table-card .card-body {
  padding-top: 0;
}

.wallet-history-table-body {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 1rem;
}

.wallet-history-table-wrap {
  border-radius: 0;
  border-left: none;
  border-right: none;
  box-shadow: none;
  margin: 0;
}

.wallet-history-table-card .table-wrap {
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.wallet-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
}

.wallet-cat-badge--debit {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

.wallet-cat-badge--commission {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.wallet-cat-badge--topup {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.35);
}

.wallet-history-thumb-link {
  display: inline-block;
  border-radius: var(--radius-sm);
  line-height: 0;
  transition: box-shadow var(--transition-fast);
}

.wallet-history-thumb-link:hover {
  box-shadow: 0 0 0 2px var(--accent);
}

.wallet-history-thumb {
  max-width: 52px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
  display: block;
}

.wallet-history-empty-cell {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.wallet-history-utr {
  font-size: 0.8125rem;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.wallet-history-empty {
  text-align: center !important;
  vertical-align: middle !important;
  padding: 2.25rem 1.25rem !important;
}

.wallet-history-empty-title {
  margin: 0 0 0.35rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.wallet-history-empty-text {
  margin: 0 0 1rem 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.wallet-history-pagination {
  margin-top: 0.85rem;
  padding: 0 1.25rem;
}

.wallet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #5eead4, #14b8a6);
}

.wallet-card h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.wallet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.wallet-table th,
.wallet-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.wallet-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wallet-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.wallet-table img {
  max-width: 60px;
  max-height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
}

.badge-pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.badge-approved {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-rejected {
  background: var(--danger-bg);
  color: #fecaca;
  border: 1px solid var(--danger-border);
}

.badge-topup {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

/* —— Admin distributor detail —— */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.info-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.info-grid span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.info-grid strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}

/* —— Admin distributor show —— */
.dist-show-page {
  width: 100%;
}

.dist-show-lead {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.dist-show-lead strong {
  color: var(--text);
  font-weight: 600;
}

.dist-show-lead .dist-show-lead-email {
  color: var(--text-muted);
  font-weight: 500;
}

.dist-show-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dist-show-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.dist-show-actions--wrap {
  justify-content: flex-end;
}

.dist-toolbar-form {
  display: inline;
  margin: 0;
}

.dist-toolbar-form button {
  margin: 0;
}

.dist-status-badge {
  margin-left: 0.5rem;
  vertical-align: middle;
}

.dist-table-row--inactive td {
  color: var(--text-muted);
}

.dist-table-row--inactive td strong {
  color: var(--text-muted);
}

.btn-sm.btn-login-as--disabled {
  display: inline-block;
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--bg-subtle) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-muted) !important;
}

.btn-sm.btn-outline--warn {
  border-color: rgba(217, 119, 6, 0.45);
  color: #b45309 !important;
}

.btn-sm.btn-outline--warn:hover {
  border-color: rgba(217, 119, 6, 0.65);
  background: rgba(251, 191, 36, 0.12);
}

html[data-theme="dark"] .btn-sm.btn-outline--warn {
  color: #fcd34d !important;
  border-color: rgba(251, 191, 36, 0.35);
}

.btn-sm.btn-danger-outline {
  background: transparent !important;
  color: var(--danger) !important;
  border: 1px solid var(--danger-border);
  box-shadow: none;
}

.btn-sm.btn-danger-outline:hover {
  background: var(--danger-bg) !important;
  box-shadow: var(--shadow-hover-sm);
}

.dist-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.dist-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.dist-kpi-pill .dist-kpi-label {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
}

.dist-panel-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-muted);
}

.dist-wallet-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 0.25rem;
}

.dist-wallet-panel {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
  background: var(--bg-subtle);
}

.dist-wallet-panel--add {
  border-left: 3px solid #0d9488;
}

.dist-wallet-panel--deduct {
  border-left: 3px solid #dc2626;
}

.dist-wallet-panel h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}

.dist-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.dist-inline-form .dist-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.dist-field--grow {
  flex: 1;
  min-width: 10rem;
}

.dist-optional {
  font-weight: 500;
  opacity: 0.85;
}

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

.dist-inline-form label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dist-inline-form input[type="number"],
.dist-inline-form input[type="text"] {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  min-width: 8rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dist-inline-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.dist-wallet-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.85rem 0 0;
  line-height: 1.45;
}

.dist-wallet-hint--flush {
  margin: 0 0 1rem;
}

.dist-wallet-hint--after-title {
  margin-top: -0.2rem;
  margin-bottom: 0.65rem;
}

.dist-pending-topups-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.dist-pending-topups-table-wrap {
  margin-top: 0.35rem;
}

.dist-pending-topups-table {
  font-size: 0.875rem;
}

.dist-pending-topups-table th,
.dist-pending-topups-table td {
  vertical-align: middle;
}

.wallet-topups-admin-page .wallet-topups-filter-banner {
  display: block;
  margin-top: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
  border: 1px solid var(--border-muted);
  line-height: 1.5;
}

.wallet-topups-admin-page .wallet-topups-filter-banner a {
  margin-left: 0.35rem;
  font-weight: 600;
  white-space: nowrap;
}

.dist-show-page .panel-card {
  margin-bottom: 1.25rem;
}

.dist-table-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75rem 0 0.65rem;
}

.dist-show-page .table-wrap + .pagination-wrap {
  margin-top: 1rem;
}

.btn-sm.btn-wallet-add {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff !important;
  border: 1px solid rgba(13, 148, 136, 0.65);
}

.btn-sm.btn-wallet-add:hover {
  box-shadow: var(--shadow-hover-sm);
  filter: brightness(1.05);
}

html[data-theme="dark"] .btn-sm.btn-wallet-add {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #f0fdfa !important;
  border-color: rgba(45, 212, 191, 0.45);
}

.btn-sm.btn-wallet-deduct {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff !important;
  border: 1px solid rgba(220, 38, 38, 0.55);
}

.btn-sm.btn-wallet-deduct:hover {
  box-shadow: var(--shadow-hover-sm);
  filter: brightness(1.05);
}

html[data-theme="dark"] .btn-sm.btn-wallet-deduct {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fef2f2 !important;
  border-color: rgba(248, 113, 113, 0.4);
}

/* —— Activation invoice (distributor) —— */
.activation-invoice-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-bottom: 2rem;
}

.activation-invoice-toolbar .activation-invoice-page-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--text);
}

.activation-invoice-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  align-items: center;
}

.activation-invoice-toolbar-actions .btn-header {
  min-width: 5.75rem;
  justify-content: center;
}

@media (max-width: 720px) {
  .activation-invoice-toolbar {
    align-items: flex-start;
  }

  .activation-invoice-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.invoice-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.invoice-header {
  background: linear-gradient(135deg, #1e1b24 0%, #121016 55%, #1a1622 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  padding: 1.35rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.invoice-header-main {
  min-width: 0;
}

.invoice-title {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.2rem 0;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.invoice-header-tag {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.72);
  font-family: var(--font-ui);
}

.invoice-header .inv-meta {
  text-align: right;
  font-size: 0.8125rem;
  color: rgba(226, 232, 240, 0.75);
  font-family: var(--font-ui);
}

.invoice-header .inv-meta strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #fff;
}

.inv-meta-date {
  display: block;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.85);
}

.invoice-body {
  padding: 1.5rem clamp(1rem, 2vw, 2rem) 0;
}

.invoice-parties {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-muted);
  align-items: start;
}

.invoice-parties .invoice-block {
  padding: 0 1.25rem;
  min-height: 100%;
}

.invoice-parties .invoice-block:first-child {
  border-right: 1px solid var(--border-muted);
  padding-left: 0;
}

.invoice-parties .invoice-block:last-child {
  padding-right: 0;
}

@media (max-width: 640px) {
  .invoice-parties {
    grid-template-columns: 1fr;
    padding-bottom: 1.25rem;
  }

  .invoice-parties .invoice-block:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-muted);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 0;
  }

  .invoice-parties .invoice-block:last-child {
    padding-left: 0;
  }
}

.invoice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.invoice-block .label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.55rem;
  font-family: var(--font-ui);
}

.invoice-block .name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
  font-family: var(--font-ui);
  line-height: 1.35;
}

.invoice-block .line {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.28rem;
  font-family: var(--font-ui);
  line-height: 1.45;
}

.inv-plan-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.inv-plan-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.inv-plan-copy {
  min-width: 0;
}

.inv-plan-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.4;
  font-family: var(--font-ui);
}

.inv-plan-days {
  font-weight: 500;
  color: var(--text-muted);
}

.inv-plan-period {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 0;
  font-family: var(--font-ui);
}

.invoice-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-muted);
}

.invoice-table td {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border-muted);
  color: var(--text);
  vertical-align: top;
}

@media (min-width: 900px) {
  .invoice-table th,
  .invoice-table td {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.invoice-table .text-right {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.invoice-table tfoot td {
  padding: 1rem 0.85rem;
  font-weight: 700;
  font-size: 1.0625rem;
  background: var(--bg-subtle);
  border-bottom: none;
  color: var(--text);
}

.invoice-table tfoot .total-row {
  border-top: 2px solid var(--border-muted);
}

.invoice-footer {
  margin: 0 calc(-1 * clamp(1rem, 2vw, 2rem));
  padding: 1.15rem clamp(1rem, 2vw, 2rem) 1.35rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-muted);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 2rem;
  align-items: start;
}

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

.invoice-footer-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.invoice-footer-key {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.invoice-footer-val {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
  font-family: var(--font-ui);
}

.invoice-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.invoice-actions .btn-sm {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

.invoice-actions .btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
}

.invoice-actions .btn-outline {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border-muted);
}

.invoice-actions .btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.invoice-actions .btn-print {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-muted);
}

.invoice-actions .btn-print:hover {
  border-color: var(--accent);
}

.company-logo-inv {
  max-width: 100px;
  max-height: 48px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border-radius: 6px;
}

@media print {
  @page {
    size: A4;
    margin: 10mm 12mm 14mm 12mm;
  }

  body * {
    visibility: hidden;
  }
  .invoice-wrap,
  .invoice-wrap * {
    visibility: visible;
  }
  .activation-invoice-page,
  .activation-invoice-page * {
    visibility: visible;
  }
  .activation-invoice-toolbar {
    display: none !important;
  }
  .activation-invoice-page {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  .invoice-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #111;
  }
  .invoice-wrap .invoice-header {
    background: #1a1520 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #fff !important;
  }
  .invoice-wrap .invoice-title,
  .invoice-wrap .invoice-header-tag,
  .invoice-wrap .inv-meta,
  .invoice-wrap .inv-meta strong,
  .invoice-wrap .inv-meta-date {
    color: #fff !important;
  }
  .invoice-wrap .invoice-body,
  .invoice-wrap .invoice-footer,
  .invoice-wrap .invoice-table th,
  .invoice-wrap .invoice-table td,
  .invoice-wrap .invoice-block .name,
  .invoice-wrap .invoice-block .line,
  .invoice-wrap .inv-plan-title,
  .invoice-wrap .inv-plan-period,
  .invoice-wrap .invoice-footer-val {
    color: #111 !important;
  }
  .invoice-wrap .invoice-footer-key {
    color: #444 !important;
  }
  .invoice-actions {
    display: none !important;
  }
}

/* —— Service order modal —— */
.service-order-modal-inner .of-service--modal {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.service-order-modal-inner .of-card--modal {
  margin-bottom: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.service-order-modal-inner .of-card-title {
  margin-top: 0.15rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-muted);
}

.service-order-modal-placeholder,
.service-order-modal-loading {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.service-order-modal-placeholder strong {
  color: var(--text);
  font-weight: 600;
}

.service-order-modal-error {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.service-order-modal-error p {
  margin: 0 0 0.65rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* —— Service order form —— */
.of-page {
  max-width: 520px;
}

.of-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.of-back:hover {
  color: var(--accent-hover);
}

.of-service {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.of-service img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-muted);
}

.of-service-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.of-service-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-hover);
  font-variant-numeric: tabular-nums;
}

.of-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.of-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
  font-family: var(--font-display);
}

.of-group {
  margin-bottom: 1rem;
}

.of-group:last-child {
  margin-bottom: 0;
}

.of-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.of-group input[type="text"],
.of-group textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--bg-subtle);
  color: var(--text);
}

.of-group textarea {
  min-height: 90px;
  resize: vertical;
}

.of-group input:focus,
.of-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.of-group .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.of-group input[type="file"] {
  width: 100%;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
}

.of-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.of-btn:hover {
  box-shadow: var(--shadow-hover-lg);
}

.of-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* —— Service orders list —— */
.svo-page {
  max-width: none;
  width: 100%;
}

.svo-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.svo-nav a {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
}

.svo-nav a.svo-nav-active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  box-shadow: var(--shadow-hover-sm);
}

.svo-nav a:not(.svo-nav-active) {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  color: var(--text-muted);
}

.svo-nav a:not(.svo-nav-active):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.svo-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.svo-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.svo-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.svo-table-wrap th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.svo-table-wrap td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-muted);
  color: var(--text);
}

.svo-table-wrap tbody tr {
  transition: background var(--transition-fast);
}

.svo-table-wrap tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.svo-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.svo-badge-pending {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.35);
}

.svo-badge-processing {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.35);
}

.svo-badge-done {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.svo-badge-cancelled {
  background: var(--danger-bg);
  color: #fecaca;
  border-color: var(--danger-border);
}

.svo-btn-view {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
}

.svo-btn-view:hover {
  box-shadow: var(--shadow-hover-sm);
}

.svo-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.svo-pagination {
  margin-top: 1.25rem;
}

.badge-done {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-cancelled {
  background: var(--danger-bg);
  color: #fecaca;
  border: 1px solid var(--danger-border);
}

/* —— Sales activation create form —— */
.act-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
  max-width: 720px;
  position: relative;
  overflow: hidden;
}

.act-form-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), #8b7355);
}

.act-form-card .form-group {
  margin-bottom: 0.85rem;
}

.act-form-card .form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
}

.act-form-card .form-group input,
.act-form-card .form-group select,
.act-form-card .form-group textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--bg-subtle);
  color: var(--text);
  transition: var(--transition-fast);
}

.act-form-card .form-group input:focus,
.act-form-card .form-group select:focus,
.act-form-card .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.act-form-card .form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.act-form-card .form-group .error {
  color: #fca5a5;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.act-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.act-form-row .form-group {
  flex: 1 1 200px;
  min-width: 0;
}

.act-form-card .btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-muted);
}

.act-form-card .btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#contact-message,
#na-contact-message {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  min-height: 1.25rem;
}

#contact-message.checking,
#na-contact-message.checking {
  color: var(--text-muted);
}

#contact-message.exists,
#contact-message.new-customer,
#na-contact-message.exists,
#na-contact-message.new-customer {
  color: var(--success);
  font-weight: 600;
}

#contact-message.error,
#na-contact-message.error {
  color: #fca5a5;
}

.company-action-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-top: 0.35rem;
}

.company-action-box > label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.company-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.company-options label.opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.company-options label.opt:hover {
  border-color: var(--border);
  color: var(--text);
}

.company-options label.opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-muted);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.company-options label.opt input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#existing-companies-wrap,
#na-existing-companies-wrap {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

#existing-companies-wrap .company-select-label,
#na-existing-companies-wrap .company-select-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

#existing-companies-wrap .company-select-hint,
#na-existing-companies-wrap .company-select-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

#existing_company_id,
#na-existing_company_id {
  width: 100%;
  padding: 0.65rem 2.25rem 0.65rem 0.75rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  background-color: var(--bg-card);
  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='%234f46e5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  color: var(--text);
  cursor: pointer;
  appearance: none;
}

#existing_company_id:focus,
#na-existing_company_id:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.company-options label.opt input {
  accent-color: var(--accent);
}

.check-again {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  text-decoration: none;
}

.check-again:hover {
  color: var(--accent);
  text-decoration: underline;
}

.plan-image-preview img {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
}

/* —— Responsive sidebar —— */
@media (max-width: 768px) {
  .sidebar {
    width: 76px;
    min-width: 76px;
  }
  .layout-right {
    margin-left: 76px;
  }
  .sidebar-brand .brand-text {
    display: none;
  }
  .sidebar-brand .brand-mobile {
    display: inline;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent);
  }
  .nav-label,
  .nav-item span {
    display: none;
  }
  .nav-dropdown-trigger .nav-dropdown-text {
    display: none;
  }
  .nav-dropdown-trigger .nav-dropdown-chevron {
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    max-height: 220px;
  }
  .nav-dropdown-menu .nav-item {
    margin: 0 0.2rem 0.1rem;
    padding: 0.65rem;
    justify-content: center;
  }
  .main {
    padding: 1rem;
  }
  .header {
    padding: 0.65rem 1rem;
  }
}

/* —— Admin service order (show) —— */
.admin-service-order-page {
  width: 100%;
  max-width: none;
}

.admin-so-header .content-header-title,
.admin-so-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.02em;
}

.admin-so-header .content-header-desc,
.admin-so-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  max-width: 48rem;
  line-height: 1.45;
}

.admin-so-muted {
  font-size: 0.8125rem !important;
  margin-top: 0.35rem !important;
  color: var(--text-muted) !important;
}

.admin-so-chat-wrap {
  max-height: min(52vh, 520px);
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.admin-so-chat {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}

.admin-so-date-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.65rem 0;
}

.admin-so-date-sep span {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.2rem 0.65rem;
  background: var(--bg-subtle);
  border-radius: 999px;
  border: 1px solid var(--border-muted);
}

.admin-so-order-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.admin-so-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.admin-so-att-thumb {
  display: block;
  line-height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-muted);
  max-width: 140px;
}

.admin-so-att-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: cover;
}

.admin-so-att-file {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.admin-so-att-file:hover {
  border-color: var(--accent);
  text-decoration: underline;
}

.admin-so-reply-intro {
  margin: 0 0 1rem 0;
}

.admin-so-file-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 560px) {
  .admin-so-file-row {
    grid-template-columns: 1fr;
  }
}

.admin-so-file-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.admin-so-file-input {
  width: 100%;
  font-size: 0.8125rem;
}

.admin-so-reply-actions {
  margin-top: 0.25rem;
}

/* Full-screen attachment preview (service order) */
.so-file-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.94);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease-out), visibility 0.2s;
}

.so-file-overlay.so-file-open {
  opacity: 1;
  visibility: visible;
}

html[data-theme="dark"] .so-file-overlay {
  background: rgba(0, 0, 0, 0.92);
}

.so-file-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.so-file-close {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.so-file-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.so-file-filename {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.so-file-preview-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.so-file-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.so-file-nopreview {
  text-align: center;
  color: #94a3b8;
}

.so-file-docicon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.so-file-nopreview-text {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.so-file-meta {
  font-size: 0.75rem;
  opacity: 0.85;
}

.so-file-footer {
  flex-shrink: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
}

.so-file-msg-wrap textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 3rem;
  margin-bottom: 0.65rem;
}

.so-file-msg-wrap textarea::placeholder {
  color: rgba(248, 250, 252, 0.45);
}

.so-file-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.so-file-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border-radius: 999px;
  margin-right: auto;
}

.so-file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.so-file-addmore {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.so-file-addmore:hover {
  background: rgba(255, 255, 255, 0.15);
}

.so-file-send-btn {
  min-width: 5rem;
}

/* SweetAlert2 — match panel typography */
.swal2-popup.premium-swal-popup {
  font-family: var(--font-ui);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.swal2-popup.premium-swal-popup .swal2-title {
  color: var(--text);
  font-weight: 600;
}

.swal2-popup.premium-swal-popup .swal2-html-container,
.swal2-popup.premium-swal-popup .swal2-content {
  color: var(--text-muted);
  font-weight: 400;
}

/* Smaller delete confirmations */
.swal2-popup.premium-swal-popup--compact .swal2-title {
  font-size: 1.05rem;
  line-height: 1.35;
  padding: 0 0.25rem;
  margin: 0 0 0.35rem 0;
}

.swal2-popup.premium-swal-popup--compact .swal2-html-container,
.swal2-popup.premium-swal-popup--compact .swal2-content {
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0;
  padding: 0 0.25rem;
}

.swal2-popup.premium-swal-popup--compact .swal2-icon {
  width: 2.65rem;
  height: 2.65rem;
  margin: 0 auto 0.5rem;
}

.swal2-popup.premium-swal-popup--compact .swal2-icon-content {
  font-size: 1.5rem;
}

.swal2-popup.premium-swal-popup--compact .swal2-actions {
  margin: 0.75rem 0 0 0;
  gap: 0.45rem;
}

.swal2-popup.premium-swal-popup--compact .swal2-styled {
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}
