/* Oxyping Admin Design System — production SaaS shell
   Loaded after page inline styles so shared components stay consistent. */

@font-face {
  font-family: "IranYekan";
  src: url("../assets/fonts/Qs_Iranyekan.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IranYekan";
  src: url("../assets/fonts/Qs_Iranyekan_medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IranYekan";
  src: url("../assets/fonts/Qs_Iranyekan_bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IranYekan";
  src: url("../assets/fonts/Qs_Iranyekan_bold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --op-bg: #07090d;
  --op-surface: #10151c;
  --op-surface-2: #161d27;
  --op-surface-3: #1c2531;
  --op-border: rgba(255, 255, 255, 0.075);
  --op-border-strong: rgba(255, 255, 255, 0.14);
  --op-text: #f1f5f9;
  --op-text-muted: #94a3b8;
  --op-text-faint: #64748b;
  --op-primary: #e8c547;
  --op-primary-soft: rgba(232, 197, 71, 0.14);
  --op-primary-hover: #f3d56a;
  --op-primary-ink: #14110a;
  --op-success: #34d399;
  --op-success-soft: rgba(52, 211, 153, 0.12);
  --op-warning: #fbbf24;
  --op-warning-soft: rgba(251, 191, 36, 0.14);
  --op-danger: #f87171;
  --op-danger-soft: rgba(248, 113, 113, 0.12);
  --op-info: #38bdf8;
  --op-info-soft: rgba(56, 189, 248, 0.12);
  --op-ring: rgba(232, 197, 71, 0.5);
  --op-radius-sm: 8px;
  --op-radius: 12px;
  --op-radius-md: 16px;
  --op-radius-lg: 22px;
  --op-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px rgba(0, 0, 0, 0.28);
  --op-shadow-md: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px rgba(0, 0, 0, 0.38);
  --op-sidebar: 17rem;
  --op-sidebar-collapsed: 5rem;
  --op-header-h: 4rem;
  --op-transition: 180ms cubic-bezier(.22, 1, .36, 1);
  --op-focus-ring: 0 0 0 2px var(--op-bg), 0 0 0 4px var(--op-ring);
  color-scheme: dark;
}

html { scroll-behavior: smooth; }

body.admin-shell {
  font-family: "IranYekan", Vazirmatn, Tahoma, sans-serif;
  background-color: var(--op-bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 100% -18%, rgba(232, 197, 71, 0.1), transparent 58%),
    radial-gradient(ellipse 55% 40% at -8% 108%, rgba(56, 189, 248, 0.07), transparent 52%),
    radial-gradient(ellipse 40% 30% at 70% 120%, rgba(232, 197, 71, 0.04), transparent 50%);
  color: var(--op-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.admin-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 0%, #000 15%, transparent 78%);
}

body.admin-shell #grid-pattern { display: none !important; }

/* ---------- Layout shell ---------- */
.admin-shell #sidebar {
  width: var(--op-sidebar);
  background: linear-gradient(180deg, rgba(16, 21, 28, 0.92) 0%, rgba(10, 13, 18, 0.96) 100%);
  border-left: 1px solid var(--op-border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.22);
  transition: width var(--op-transition), transform 220ms ease;
}

.admin-shell #main-content-wrapper {
  transition: margin-right var(--op-transition);
  min-width: 0;
  width: 100%;
}

@media (min-width: 1024px) {
  .admin-shell #main-content-wrapper {
    margin-right: var(--op-sidebar);
  }
  body.sidebar-collapsed.admin-shell #sidebar {
    width: var(--op-sidebar-collapsed);
  }
  body.sidebar-collapsed.admin-shell #main-content-wrapper {
    margin-right: var(--op-sidebar-collapsed);
  }
}

.admin-shell .admin-header {
  height: auto;
  min-height: var(--op-header-h);
  background: rgba(7, 9, 13, 0.72);
  border-bottom: 1px solid var(--op-border);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.admin-header-inner {
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1rem 0.85rem;
}
@media (min-width: 640px) {
  .admin-header-inner { padding: 0.85rem 1.5rem 0.95rem; }
}
@media (min-width: 1024px) {
  .admin-header-inner { padding: 0.9rem 2rem 1rem; }
}

.admin-header-main {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.admin-header-identity {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
}

.admin-header-copy {
  min-width: 0;
  padding-top: 0.1rem;
}

.admin-page-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
@media (min-width: 640px) {
  .admin-page-title { font-size: 1.4rem; }
}

.admin-page-subtitle {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--op-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-header-aside {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.6rem;
  width: auto;
  min-width: 0;
  flex: 1 1 12rem;
  max-width: 100%;
}

.page-actions-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
}
@media (min-width: 900px) {
  .page-actions-slot { justify-content: flex-end; }
}

.page-actions-slot:empty {
  display: none;
}

.logout-header-btn {
  flex-shrink: 0;
  align-self: center;
  justify-content: center;
}
.logout-header-btn:hover {
  border-color: rgba(248, 81, 73, 0.45);
  color: #fda4a4;
}

/* Compact action toolbar used in page_actions */
.op-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.45rem;
  border: 1px solid var(--op-border);
  border-radius: 14px;
  background: rgba(22, 29, 39, 0.78);
  backdrop-filter: blur(12px);
}
@media (min-width: 900px) {
  .op-toolbar {
    width: auto;
    max-width: 100%;
  }
}

.op-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.op-toolbar-divider {
  display: none;
  width: 1px;
  align-self: stretch;
  min-height: 1.75rem;
  background: var(--op-border);
  margin: 0 0.15rem;
}
@media (min-width: 640px) {
  .op-toolbar-divider { display: block; }
}

.op-toolbar .op-select,
.op-toolbar-select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: 2.25rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.8125rem;
}
@media (min-width: 480px) {
  .op-toolbar .op-select,
  .op-toolbar-select {
    width: auto;
    min-width: 9.5rem;
    max-width: 14rem;
  }
}

.op-toolbar .op-btn,
.op-btn-sm {
  height: 2.25rem;
  padding: 0 0.8rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.op-toolbar .op-input {
  height: 2.25rem;
  font-size: 0.8125rem;
  min-width: 0;
  width: 100%;
}
@media (min-width: 480px) {
  .op-toolbar .op-input {
    width: 12rem;
  }
}
.op-toolbar .op-search {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 18rem;
  position: relative;
}
.op-toolbar .op-search .op-input {
  width: 100%;
  padding-left: 2.35rem;
  padding-right: 0.75rem;
}
.op-toolbar .op-search .op-icon-btn {
  position: absolute;
  left: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
}
.op-toolbar .op-search .op-icon-btn i {
  position: static;
  transform: none;
  pointer-events: auto;
  color: inherit;
}

.admin-shell .admin-main {
  padding: 0.85rem 1rem 2.5rem;
  overflow-x: clip;
}

@media (min-width: 640px) {
  .admin-shell .admin-main { padding: 1rem 1.5rem 3rem; }
}
@media (min-width: 1024px) {
  .admin-shell .admin-main { padding: 1.1rem 2rem 3rem; }
}

/* ---------- Sidebar nav ---------- */
.nav-section {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  padding: 0 0.75rem;
}
.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--op-text-faint);
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
}
body.sidebar-collapsed .nav-section-label { opacity: 0; height: 0; margin: 0; padding: 0; }

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 0.8rem;
  margin: 0.12rem 0.45rem;
  border-radius: 12px;
  border-right: 0;
  color: var(--op-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--op-transition), color var(--op-transition), box-shadow var(--op-transition);
  transform: none !important;
}
.menu-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--op-text);
  border-right-color: transparent;
  transform: none !important;
}
.menu-link:focus-visible {
  outline: none;
  box-shadow: var(--op-focus-ring);
}
.menu-link.active {
  background: var(--op-primary-soft);
  color: var(--op-primary);
  border-right-color: transparent;
  font-weight: 700;
  background-image: none !important;
  box-shadow: inset 3px 0 0 var(--op-primary);
}
.menu-link.active:hover { transform: none !important; }
.menu-icon {
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 1.75;
  flex-shrink: 0;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.15rem;
}
.menu-link-text { white-space: nowrap; transition: opacity 120ms ease; }
.menu-badge {
  min-width: 1.2rem;
  height: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.menu-badge--warn { background: var(--op-warning); color: #111; }
.menu-badge--danger { background: var(--op-danger); color: #fff; }

body.sidebar-collapsed .menu-link { justify-content: center; gap: 0; padding-left: 0.5rem; padding-right: 0.5rem; }
body.sidebar-collapsed .menu-link-text,
body.sidebar-collapsed .sidebar-header-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
body.sidebar-collapsed #sidebar-toggle-icon { transform: rotate(180deg); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.sidebar-brand-logo {
  width: 2.15rem;
  height: 2.15rem;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  border-radius: 10px;
  filter: drop-shadow(0 0 14px rgba(232, 197, 71, 0.18));
}
.sidebar-brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(232, 197, 71, 0.28), rgba(232, 197, 71, 0.08));
  color: var(--op-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(232, 197, 71, 0.35);
  box-shadow: 0 0 20px rgba(232, 197, 71, 0.12);
}
body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  width: 100%;
}
body.sidebar-collapsed .sidebar-brand-logo {
  width: 2.15rem;
  height: 2.15rem;
}
.sidebar-footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--op-radius);
  border: 1px solid var(--op-border);
  background: var(--op-surface-2);
  color: var(--op-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background var(--op-transition), color var(--op-transition), border-color var(--op-transition);
}
.sidebar-footer-link:hover {
  background: var(--op-info-soft);
  border-color: rgba(88, 166, 255, 0.35);
  color: var(--op-info);
}
.sidebar-footer-link.logout-link {
  color: var(--op-danger);
  border-color: rgba(248, 81, 73, 0.25);
  background: var(--op-danger-soft);
}
.sidebar-footer-link.logout-link:hover {
  background: rgba(248, 81, 73, 0.2);
  border-color: rgba(248, 81, 73, 0.4);
  color: var(--op-danger);
}
.logout-header-btn {
  color: var(--op-text-muted) !important;
  border-color: var(--op-border) !important;
}
.logout-header-btn:hover {
  color: var(--op-danger) !important;
  border-color: rgba(248, 81, 73, 0.35) !important;
  background: var(--op-danger-soft) !important;
}

/* ---------- Cards (overrides legacy glass-card) ---------- */
.glass-card,
.op-card {
  background: linear-gradient(180deg, rgba(22, 29, 39, 0.92) 0%, rgba(16, 21, 28, 0.94) 100%) !important;
  border: 1px solid var(--op-border) !important;
  border-radius: var(--op-radius-md) !important;
  box-shadow: var(--op-shadow) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  position: relative;
  transition:
    border-color 180ms ease,
    box-shadow 220ms ease,
    transform 220ms ease,
    opacity 420ms cubic-bezier(.22,1,.36,1);
}
.glass-card::before,
.op-card::before { display: none !important; }
.glass-card:hover,
.op-card:hover {
  border-color: rgba(232, 197, 71, 0.22) !important;
  transform: translateY(-2px);
  box-shadow: var(--op-shadow-md) !important;
}
.glass-card.is-visible { opacity: 1; transform: none; }

.op-kpi {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
}
.op-kpi-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--op-border);
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.op-kpi-label {
  font-size: 0.8rem;
  color: var(--op-text-muted);
  font-weight: 500;
}
.op-kpi-value {
  margin-top: 0.2rem;
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* ---------- Tables ---------- */
.op-table,
.sales-table,
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
}
.op-table thead th,
.sales-table thead th,
table.data-table thead th {
  background: var(--op-surface-2);
  color: var(--op-text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--op-border);
  white-space: nowrap;
}
.op-table tbody td,
.sales-table tbody td,
table.data-table tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--op-border);
  color: var(--op-text);
  vertical-align: middle;
}
.op-table tbody tr:hover,
.sales-table tbody tr:hover,
table.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}
.op-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--op-radius-md);
}

.stagger-item {
  opacity: 1 !important;
  transform: none !important;
}

/* ---------- Buttons ---------- */
.op-btn,
.panel-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--op-radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background var(--op-transition), border-color var(--op-transition), color var(--op-transition), opacity var(--op-transition);
  cursor: pointer;
  line-height: 1.2;
}
.op-btn:focus-visible,
.panel-action-btn:focus-visible,
.op-icon-btn:focus-visible,
.sidebar-footer-link:focus-visible {
  outline: none;
  box-shadow: var(--op-focus-ring);
}
.op-btn:disabled,
.panel-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.op-btn-primary,
.panel-action-btn.primary,
button.bg-brand-primary {
  background: linear-gradient(180deg, #f3d56a 0%, var(--op-primary) 100%) !important;
  color: var(--op-primary-ink) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 22px rgba(232, 197, 71, 0.22);
}
.op-btn-primary:hover:not(:disabled),
.panel-action-btn.primary:hover:not(:disabled) {
  background: var(--op-primary-hover) !important;
}
.op-btn-secondary {
  background: var(--op-surface-2);
  color: var(--op-text);
  border-color: var(--op-border);
}
.op-btn-secondary:hover:not(:disabled) {
  background: var(--op-surface-3);
  border-color: var(--op-border-strong);
}
.op-btn-danger {
  background: var(--op-danger-soft);
  color: var(--op-danger);
  border-color: rgba(248, 81, 73, 0.35);
}
.op-btn-danger:hover:not(:disabled) {
  background: rgba(248, 81, 73, 0.22);
}
.op-btn-ghost {
  background: transparent;
  color: var(--op-text-muted);
  border-color: transparent;
}
.op-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--op-text);
}
.op-icon-btn {
  width: 2.1rem;
  height: 2.1rem;
  min-height: 0;
  padding: 0;
  border-radius: var(--op-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--op-text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--op-transition), color var(--op-transition);
}
.op-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--op-text);
}
.op-icon-btn.danger:hover {
  background: var(--op-danger-soft);
  color: var(--op-danger);
}

/* ---------- Forms ---------- */
.op-input,
.op-select,
.op-textarea,
input.form-input,
select.form-input,
textarea.form-input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--op-radius);
  background: var(--op-surface-2);
  border: 1px solid var(--op-border);
  color: var(--op-text);
  font-size: 0.875rem;
  transition: border-color var(--op-transition), box-shadow var(--op-transition);
}
.op-input:focus,
.op-select:focus,
.op-textarea:focus,
input.form-input:focus,
select.form-input:focus,
textarea.form-input:focus {
  outline: none;
  border-color: rgba(230, 184, 0, 0.55);
  box-shadow: 0 0 0 3px var(--op-primary-soft);
}
.op-input:focus-visible,
.op-select:focus-visible,
.op-textarea:focus-visible,
input.form-input:focus-visible,
select.form-input:focus-visible,
textarea.form-input:focus-visible {
  outline: none;
  box-shadow: var(--op-focus-ring);
  border-color: var(--op-primary);
}
.op-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--op-text-muted);
}
.op-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
  padding: 1rem;
  background: rgba(16, 21, 28, 0.82);
  border: 1px solid var(--op-border);
  border-radius: var(--op-radius-md);
  margin-bottom: 1rem;
  backdrop-filter: blur(12px);
}
.op-search {
  position: relative;
  flex: 1 1 14rem;
  min-width: 12rem;
}
.op-search i,
.op-search .op-search-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--op-text-faint);
  pointer-events: none;
}
.op-search input {
  padding-right: 2.4rem;
}

/* ---------- Badges ---------- */
.op-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--op-radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}
.op-badge-success { background: var(--op-success-soft); color: var(--op-success); border-color: rgba(63,185,80,.25); }
.op-badge-warning { background: var(--op-warning-soft); color: #e3b341; border-color: rgba(210,153,34,.3); }
.op-badge-danger { background: var(--op-danger-soft); color: var(--op-danger); border-color: rgba(248,81,73,.3); }
.op-badge-info { background: var(--op-info-soft); color: var(--op-info); border-color: rgba(88,166,255,.3); }
.op-badge-neutral { background: rgba(255,255,255,.06); color: var(--op-text-muted); border-color: var(--op-border); }
.op-badge-primary { background: var(--op-primary-soft); color: var(--op-primary); border-color: rgba(230,184,0,.3); }

/* ---------- Empty / loading ---------- */
.op-empty {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--op-text-muted);
}
.op-empty-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: var(--op-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--op-surface-2);
  border: 1px solid var(--op-border);
  color: var(--op-text-faint);
  font-size: 1.25rem;
}
.op-empty-title { color: #fff; font-weight: 700; font-size: 1rem; margin-bottom: 0.35rem; }
.op-empty-desc { font-size: 0.85rem; max-width: 26rem; margin: 0 auto; }

.op-spinner {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--op-primary);
  border-radius: 50%;
  animation: op-spin 0.7s linear infinite;
}
@keyframes op-spin { to { transform: rotate(360deg); } }

/* ---------- Modal ---------- */
.op-modal-overlay,
#modal-container .fixed.inset-0 {
  background: rgba(0, 0, 0, 0.62) !important;
  backdrop-filter: blur(2px);
}
.op-modal,
.modal-panel {
  background: var(--op-surface) !important;
  border: 1px solid var(--op-border) !important;
  border-radius: var(--op-radius-lg) !important;
  box-shadow: var(--op-shadow-md) !important;
}

/* ---------- Toast ---------- */
#op-toast-root {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
@media (min-width: 640px) {
  #op-toast-root {
    right: auto;
    width: 22rem;
  }
}
.op-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--op-radius-md);
  background: var(--op-surface-2);
  border: 1px solid var(--op-border);
  box-shadow: var(--op-shadow-md);
  color: var(--op-text);
  font-size: 0.85rem;
  animation: op-toast-in 180ms ease;
}
.op-toast.closing { animation: op-toast-out 160ms ease forwards; }
.op-toast-success { border-right: 3px solid var(--op-success); }
.op-toast-error { border-right: 3px solid var(--op-danger); }
.op-toast-warning { border-right: 3px solid var(--op-warning); }
.op-toast-info { border-right: 3px solid var(--op-info); }
@keyframes op-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes op-toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* Legacy toast used on dashboard */
.toast-notification {
  background: var(--op-surface-2) !important;
  backdrop-filter: none !important;
  border-radius: var(--op-radius-md) !important;
  box-shadow: var(--op-shadow-md) !important;
}

/* ---------- Misc ---------- */
.admin-shell ::-webkit-scrollbar { width: 8px; height: 8px; }
.admin-shell ::-webkit-scrollbar-track { background: var(--op-bg); }
.admin-shell ::-webkit-scrollbar-thumb { background: #30363d; border-radius: 8px; }
.admin-shell ::-webkit-scrollbar-thumb:hover { background: #484f58; }

.ltr-num, .mono-ltr {
  direction: ltr;
  unicode-bidi: plaintext;
  font-variant-numeric: tabular-nums;
}

a.menu-link,
a.op-btn,
a.sidebar-footer-link,
button,
[role="button"] {
  cursor: pointer;
}

.flash-stack {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(28rem, calc(100% - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.flash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--op-radius-md);
  border: 1px solid var(--op-border);
  background: var(--op-surface-2);
  font-size: 0.85rem;
  box-shadow: var(--op-shadow-md);
}
.flash-item.success { border-right: 3px solid var(--op-success); color: var(--op-success); }
.flash-item.danger,
.flash-item.error { border-right: 3px solid var(--op-danger); color: var(--op-danger); }
.flash-item.info { border-right: 3px solid var(--op-info); color: var(--op-info); }

#cursor-glow { display: none !important; }

.page-actions-slot > .op-toolbar {
  width: 100%;
}
@media (min-width: 900px) {
  .page-actions-slot > .op-toolbar {
    width: auto;
  }
}
.page-actions-slot > .op-btn,
.page-actions-slot > a.op-btn,
.page-actions-slot > form {
  width: auto;
  flex: 0 0 auto;
}
.mobile-scroll-tabs {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mobile-scroll-tabs::-webkit-scrollbar { display: none; }

/* =========================================================
   Global motion system
   ========================================================= */

@media (prefers-reduced-motion: no-preference) {
  .admin-main {
    animation: op-page-in .35s cubic-bezier(.22,1,.36,1) both;
  }
  .admin-page-title {
    animation: op-title-in .4s cubic-bezier(.22,1,.36,1) both;
  }
  .admin-page-subtitle {
    animation: op-title-in .45s cubic-bezier(.22,1,.36,1) .05s both;
  }
  .page-actions-slot,
  .logout-header-btn {
    animation: op-fade-up .4s cubic-bezier(.22,1,.36,1) .08s both;
  }

  .op-reveal {
    opacity: 1;
    transform: none;
  }
  .op-reveal.is-in {
    opacity: 1;
    transform: none;
  }

  .op-btn,
  .panel-action-btn,
  .op-icon-btn,
  .submit-btn,
  button.bg-brand-primary {
    transition:
      background 160ms ease,
      border-color 160ms ease,
      color 160ms ease,
      opacity 160ms ease,
      transform 140ms ease,
      box-shadow 180ms ease !important;
  }
  .op-btn:hover:not(:disabled),
  .panel-action-btn:hover:not(:disabled),
  button.bg-brand-primary:hover:not(:disabled) {
    transform: translateY(-1px);
  }
  .op-btn:active:not(:disabled),
  .panel-action-btn:active:not(:disabled),
  .op-icon-btn:active,
  button.bg-brand-primary:active:not(:disabled) {
    transform: scale(.97);
  }

  .op-btn-primary,
  .panel-action-btn.primary,
  button.bg-brand-primary {
    position: relative;
    overflow: hidden;
  }
  .op-btn-primary::after,
  .panel-action-btn.primary::after,
  button.bg-brand-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%);
    transform: translateX(-130%);
    transition: transform .55s ease;
    pointer-events: none;
  }
  .op-btn-primary:hover::after,
  .panel-action-btn.primary:hover::after,
  button.bg-brand-primary:hover::after {
    transform: translateX(130%);
  }

  .menu-link {
    transition:
      background 160ms ease,
      color 160ms ease,
      border-color 160ms ease,
      transform 160ms ease,
      padding 160ms ease !important;
  }
  .menu-link:hover {
    transform: translateX(-2px) !important;
  }
  .menu-link.active {
    animation: op-nav-pulse .5s ease both;
  }
  .menu-link .menu-icon {
    transition: transform 180ms ease, color 160ms ease;
  }
  .menu-link:hover .menu-icon {
    transform: scale(1.08);
  }

  .op-table tbody tr,
  .sales-table tbody tr,
  table.data-table tbody tr {
    transition: background 150ms ease, transform 150ms ease;
  }
  .op-table tbody tr:hover,
  .sales-table tbody tr:hover,
  table.data-table tbody tr:hover {
    background: rgba(230, 184, 0, 0.04);
  }

  .op-input:focus,
  .op-select:focus,
  .op-textarea:focus,
  input.form-input:focus,
  select.form-input:focus,
  textarea.form-input:focus {
    transition: border-color 160ms ease, box-shadow 180ms ease, background 160ms ease;
  }

  .op-badge {
    transition: transform 150ms ease, background 150ms ease;
  }
  .op-badge:hover { transform: translateY(-1px); }

  .op-kpi-value {
    transition: transform 200ms ease;
  }
  .op-card:hover .op-kpi-value {
    transform: scale(1.02);
  }

  .flash-item {
    animation: op-flash-in .35s cubic-bezier(.22,1,.36,1) both;
  }

  .admin-header {
    transition: box-shadow 200ms ease, background 200ms ease;
  }
  body.op-scrolled .admin-header {
    box-shadow: 0 10px 28px rgba(0,0,0,.28);
    background: rgba(7, 9, 13, 0.88);
  }

  /* Soft skeleton shimmer for loading placeholders */
  .op-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04));
    background-size: 200% 100%;
    animation: op-shimmer 1.2s linear infinite;
    border-radius: 8px;
  }
}

@keyframes op-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes op-title-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes op-fade-up {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes op-nav-pulse {
  from { box-shadow: inset 0 0 0 0 rgba(230,184,0,0); }
  40% { box-shadow: inset 0 0 0 1px rgba(230,184,0,.18); }
  to { box-shadow: inset 0 0 0 0 rgba(230,184,0,0); }
}
@keyframes op-flash-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes op-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .admin-main,
  .admin-page-title,
  .admin-page-subtitle,
  .page-actions-slot,
  .logout-header-btn,
  .op-reveal,
  .flash-item,
  .menu-link.active,
  .op-toast,
  .op-spinner,
  .op-skeleton {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .op-card:hover,
  .glass-card:hover,
  .op-btn:hover,
  .op-btn:active,
  .menu-link:hover,
  .op-badge:hover,
  .op-card:hover .op-kpi-value {
    transform: none !important;
  }
  .op-btn-primary::after,
  .panel-action-btn.primary::after,
  button.bg-brand-primary::after {
    display: none !important;
  }
}

/* Modals: keep the box in the first viewport. Tall dialogs scroll
   inside the overlay instead of sitting in the middle of a long page. */
.modal-backdrop,
#modal-container .modal-backdrop,
#modal-root .modal-backdrop {
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1rem !important;
}
.modal-backdrop > *,
#modal-container .modal-backdrop > *,
#modal-root .modal-backdrop > * {
  margin-top: auto;
  margin-bottom: auto;
  flex-shrink: 0;
}

/* =========================================================
   Auth: login + OTP  (2026 atmospheric shell)
   ========================================================= */

html:has(body.auth-shell) {
  background: #05070a;
}

.auth-shell {
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  font-family: "IranYekan", Tahoma, sans-serif;
  background: #05070a;
  color: var(--op-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.auth-shell,
.auth-shell * { box-sizing: border-box; }

.auth-aurora,
.auth-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.auth-aurora {
  z-index: 0;
  background: radial-gradient(ellipse 72% 48% at 50% -12%, rgba(232, 197, 71, 0.13), transparent 62%);
}
.auth-aurora--otp {
  background:
    radial-gradient(ellipse 68% 46% at 50% -10%, rgba(232, 197, 71, 0.16), transparent 60%),
    radial-gradient(ellipse 42% 28% at 50% 108%, rgba(52, 211, 153, 0.07), transparent 55%);
}

.auth-noise {
  z-index: 1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.auth-layout {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1.15rem 2rem;
}

.auth-frame {
  width: 100%;
  max-width: 400px;
  animation: auth-enter 0.55s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes auth-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.45rem;
}

.auth-logo {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 0.85rem;
  object-fit: contain;
  border-radius: 1.25rem;
  filter: drop-shadow(0 10px 28px rgba(232, 197, 71, 0.22));
}

.auth-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 0.9rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--op-primary);
  background: linear-gradient(160deg, rgba(232, 197, 71, 0.22), rgba(232, 197, 71, 0.05));
  border: 1px solid rgba(232, 197, 71, 0.4);
  box-shadow: 0 10px 32px rgba(232, 197, 71, 0.16);
  position: relative;
}
.auth-mark::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 22px;
  border: 1px solid rgba(232, 197, 71, 0.12);
  animation: auth-pulse 3.2s ease-out infinite;
}

@keyframes auth-pulse {
  0% { opacity: 0.7; transform: scale(0.92); }
  100% { opacity: 0; transform: scale(1.12); }
}

.auth-word {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.32em;
  color: #fff;
  padding-right: 0.32em;
}

.auth-rule {
  width: 42px;
  height: 2px;
  margin: 0.75rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--op-primary), transparent);
}

.auth-card {
  position: relative;
  background: linear-gradient(180deg, rgba(22, 29, 39, 0.86) 0%, rgba(12, 16, 22, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  padding: 1.7rem 1.35rem 1.5rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 28px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 197, 71, 0.65), transparent);
}
@media (min-width: 480px) {
  .auth-card { padding: 2rem 1.75rem 1.7rem; }
}

.auth-card.is-success {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(52, 211, 153, 0.12);
  transform: translateY(-2px);
}
.auth-card.is-success::before {
  background: linear-gradient(90deg, transparent, #34d399, transparent);
}

.auth-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.3rem;
}
.auth-subtitle {
  font-size: 0.8rem;
  color: var(--op-text-muted);
  margin: 0 0 1.4rem;
  line-height: 1.7;
}

.auth-alert {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.72rem 0.85rem;
  margin-bottom: 1.1rem;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: #fca5a5;
  font-size: 0.8rem;
  line-height: 1.55;
}

.auth-field + .auth-field { margin-top: 1rem; }
.auth-field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}
.auth-control { position: relative; }
.auth-control .ico {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.85rem;
  pointer-events: none;
  transition: color 0.15s ease;
}
.auth-control:focus-within .ico { color: var(--op-primary); }

.auth-control input[type="text"],
.auth-control input[type="password"] {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 7, 10, 0.72);
  color: #f1f5f9;
  padding: 0 2.5rem 0 1rem;
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-control input.with-eye { padding-left: 2.75rem; }
.auth-control input:hover { border-color: rgba(255, 255, 255, 0.16); }
.auth-control input:focus {
  border-color: rgba(232, 197, 71, 0.55);
  box-shadow: 0 0 0 4px rgba(232, 197, 71, 0.12);
  background: rgba(8, 11, 16, 0.9);
}

.auth-eye {
  position: absolute;
  left: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.auth-eye:hover { color: var(--op-primary); background: rgba(255, 255, 255, 0.05); }

.auth-btn {
  margin-top: 1.45rem;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f3d56a 0%, #e8c547 100%);
  color: #14110a;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 12px 30px rgba(232, 197, 71, 0.26);
}
.auth-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}
.auth-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(232, 197, 71, 0.32);
}
.auth-btn:hover::after { transform: translateX(120%); }
.auth-btn:active { transform: scale(0.985); }
.auth-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  filter: none;
}

.auth-meta {
  margin-top: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: #64748b;
}
.auth-meta i { color: #34d399; font-size: 0.7rem; }

.auth-foot {
  margin-top: 1.35rem;
  text-align: center;
  font-size: 0.68rem;
  color: #3f4650;
  letter-spacing: 0.18em;
}

.auth-head { text-align: center; margin-bottom: 1.3rem; position: relative; z-index: 1; }
.auth-shield {
  width: 58px; height: 58px; margin: 0 auto 0.85rem; border-radius: 18px;
  display: grid; place-items: center; color: var(--op-primary);
  background: rgba(232, 197, 71, 0.12); border: 1px solid rgba(232, 197, 71, 0.32);
  font-size: 1.2rem; transition: all 0.35s ease; position: relative;
}
.auth-shield::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  border: 1px solid rgba(232, 197, 71, 0.14);
}
.auth-card.is-success .auth-shield {
  animation: none;
  color: #05070a; background: #34d399; border-color: #34d399;
  transform: scale(1.08) rotate(-6deg);
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.35);
}
.auth-head h1 { font-size: 1.12rem; font-weight: 800; color: #fff; margin: 0; }
.auth-head p { margin-top: 0.4rem; font-size: 0.8rem; color: var(--op-text-muted); line-height: 1.65; }
.auth-expire { margin-top: 0.45rem; font-size: 0.72rem; color: #fbbf24; }

.auth-burst {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.auth-card.is-success .auth-burst {
  opacity: 1;
  background: radial-gradient(circle at 50% 45%, rgba(52, 211, 153, 0.18), transparent 55%);
  animation: auth-burst 0.9s ease both;
}
@keyframes auth-burst {
  from { opacity: 0; transform: scale(0.9); }
  40% { opacity: 1; }
  to { opacity: 0.55; transform: scale(1.05); }
}

.otp-stage {
  position: relative; min-height: 64px;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.otp-boxes {
  display: flex; direction: ltr; gap: 0.32rem; justify-content: center; width: 100%;
}
.otp-digit {
  width: 100%; max-width: 42px; height: 52px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(5, 7, 10, 0.75); color: #fff;
  text-align: center; font-size: 1.18rem; font-weight: 800; font-family: inherit;
  outline: none; caret-color: var(--op-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.35s cubic-bezier(.22,1,.36,1),
              opacity 0.35s ease, background 0.15s ease, filter 0.35s ease;
}
@media (min-width: 440px) {
  .otp-digit { max-width: 46px; height: 54px; }
  .otp-boxes { gap: 0.42rem; }
}
@media (max-width: 399px) {
  .otp-digit { max-width: 34px; height: 46px; font-size: 1.02rem; }
  .otp-boxes { gap: 0.2rem; }
}
.otp-digit:focus {
  border-color: rgba(232, 197, 71, 0.65);
  box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.14);
  background: rgba(8, 11, 16, 0.95);
}
.otp-digit.filled {
  border-color: rgba(232, 197, 71, 0.45);
  background: #121820;
  animation: auth-dig-pop 0.18s ease;
}
.auth-card--otp .otp-digit.filled {
  animation: auth-dig-pop 0.18s ease;
}
@keyframes auth-dig-pop {
  from { transform: scale(0.92); }
  to { transform: scale(1); }
}

.otp-boxes.merging .otp-digit {
  animation: none !important;
  opacity: 0; filter: blur(2px); pointer-events: none;
}
.otp-boxes.merging .otp-digit:nth-child(1) { transform: translate(110%, -8px) scale(.4); transition-delay: .00s; }
.otp-boxes.merging .otp-digit:nth-child(2) { transform: translate(75%, -4px) scale(.4); transition-delay: .03s; }
.otp-boxes.merging .otp-digit:nth-child(3) { transform: translate(40%, -2px) scale(.4); transition-delay: .06s; }
.otp-boxes.merging .otp-digit:nth-child(4) { transform: translate(12%, 0) scale(.4); transition-delay: .09s; }
.otp-boxes.merging .otp-digit:nth-child(5) { transform: translate(-12%, 0) scale(.4); transition-delay: .09s; }
.otp-boxes.merging .otp-digit:nth-child(6) { transform: translate(-40%, -2px) scale(.4); transition-delay: .06s; }
.otp-boxes.merging .otp-digit:nth-child(7) { transform: translate(-75%, -4px) scale(.4); transition-delay: .03s; }
.otp-boxes.merging .otp-digit:nth-child(8) { transform: translate(-110%, -8px) scale(.4); transition-delay: .00s; }

.otp-merged {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transform: scale(0.6);
  transition: opacity 0.35s ease 0.12s, transform 0.55s cubic-bezier(.22,1.2,.36,1) 0.12s;
}
.otp-merged.show { opacity: 1; pointer-events: auto; transform: scale(1); }
.merged-pill {
  display: inline-flex; align-items: center; gap: 0.7rem;
  min-height: 54px; padding: 0 1.35rem; border-radius: 999px;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.2), rgba(52, 211, 153, 0.08));
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #fff;
  box-shadow: 0 12px 32px rgba(52, 211, 153, 0.2);
  position: relative; overflow: hidden;
}
.merged-pill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-120%);
}
.otp-merged.show .merged-pill::after { animation: auth-shine 0.7s ease 0.2s both; }
@keyframes auth-shine { to { transform: translateX(120%); } }
.merged-code {
  direction: ltr; font-size: 1.1rem; font-weight: 800;
  letter-spacing: 0.22em; padding-left: 0.22em;
  font-variant-numeric: tabular-nums;
}
.otp-merged .check {
  width: 30px; height: 30px; border-radius: 50%;
  background: #34d399; color: #05070a;
  display: grid; place-items: center; font-size: 0.9rem;
  transform: scale(0);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
}
.otp-merged.show .check {
  animation: auth-pop-check 0.45s cubic-bezier(.22,1.4,.36,1) 0.2s both, auth-ring 0.8s ease 0.35s both;
}
@keyframes auth-pop-check {
  from { transform: scale(0) rotate(-20deg); }
  70% { transform: scale(1.2) rotate(4deg); }
  to { transform: scale(1) rotate(0); }
}
@keyframes auth-ring {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  100% { box-shadow: 0 0 0 16px rgba(52, 211, 153, 0); }
}

.auth-hint {
  margin-top: 1.15rem; text-align: center; font-size: 0.75rem;
  color: #64748b; min-height: 1.2em; transition: color 0.25s ease, transform 0.25s ease;
  position: relative; z-index: 1;
}
.auth-hint.ok { color: #34d399; font-weight: 700; transform: scale(1.02); }
.auth-back { margin-top: 1.35rem; text-align: center; font-size: 0.78rem; }
.auth-back a { color: var(--op-primary); text-decoration: none; font-weight: 600; }
.auth-back a:hover { text-decoration: underline; }
.manual-submit { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pm-username { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.auth-frame--otp { max-width: 440px; animation: none; }
.auth-brand--otp {
  animation: otp-drop 0.7s cubic-bezier(.22, 1.15, .36, 1) both;
}
.auth-card--otp {
  animation: otp-card-in 0.72s cubic-bezier(.22, 1.12, .36, 1) 0.1s both;
}
.auth-card--otp .auth-shield {
  animation: otp-shield-in 0.85s cubic-bezier(.22, 1.45, .36, 1) 0.22s both;
}
.auth-card--otp .auth-head h1 {
  animation: otp-rise 0.55s ease 0.32s both;
}
.auth-card--otp .auth-head p {
  animation: otp-rise 0.55s ease 0.4s both;
}
.auth-card--otp .auth-expire {
  animation: otp-rise 0.55s ease 0.46s both;
}
.auth-card--otp .otp-digit {
  animation: otp-digit-in 0.5s cubic-bezier(.22, 1.2, .36, 1) both;
}
.auth-card--otp .otp-digit:nth-child(1) { animation-delay: 0.38s; }
.auth-card--otp .otp-digit:nth-child(2) { animation-delay: 0.43s; }
.auth-card--otp .otp-digit:nth-child(3) { animation-delay: 0.48s; }
.auth-card--otp .otp-digit:nth-child(4) { animation-delay: 0.53s; }
.auth-card--otp .otp-digit:nth-child(5) { animation-delay: 0.58s; }
.auth-card--otp .otp-digit:nth-child(6) { animation-delay: 0.63s; }
.auth-card--otp .otp-digit:nth-child(7) { animation-delay: 0.68s; }
.auth-card--otp .otp-digit:nth-child(8) { animation-delay: 0.73s; }
.auth-card--otp .auth-hint {
  animation: otp-rise 0.5s ease 0.82s both;
}
.auth-frame--otp .auth-back {
  animation: otp-rise 0.5s ease 0.9s both;
}

@keyframes otp-drop {
  from { opacity: 0; transform: translateY(-18px) scale(0.94); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes otp-card-in {
  from { opacity: 0; transform: translateY(28px) scale(0.94); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes otp-shield-in {
  from { opacity: 0; transform: scale(0.4) rotate(-18deg); }
  62% { transform: scale(1.12) rotate(4deg); }
  to { opacity: 1; transform: none; }
}
@keyframes otp-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes otp-digit-in {
  from { opacity: 0; transform: translateY(18px) scale(0.7); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-mark::after,
  .auth-frame,
  .auth-brand--otp,
  .auth-card--otp,
  .auth-card--otp .auth-shield,
  .auth-card--otp .auth-head h1,
  .auth-card--otp .auth-head p,
  .auth-card--otp .auth-expire,
  .auth-card--otp .otp-digit,
  .auth-card--otp .auth-hint,
  .auth-frame--otp .auth-back,
  .auth-card.is-success .auth-burst,
  .otp-digit.filled {
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .auth-btn::after,
  .merged-pill::after { display: none !important; }
}
