/* ==========================================================================
   AMMODERN DESIGN SYSTEM — SAAS DASHBOARD & MARKETPLACE THEME
   Inspired by Linear, Stripe, Vercel, and shadcn/ui
   ========================================================================== */

:root {
  --am-primary: #4f46e5;
  --am-primary-hover: #4338ca;
  --am-primary-light: rgba(79, 70, 229, 0.08);
  --am-accent: #06b6d4;
  --am-success: #10b981;
  --am-warning: #f59e0b;
  --am-danger: #ef4444;

  --am-bg: #f8fafc;
  --am-surface: #ffffff;
  --am-surface-subtle: #f1f5f9;
  --am-surface-hover: #f8fafc;
  --am-text: #0f172a;
  --am-text-muted: #64748b;
  --am-text-faint: #94a3b8;
  --am-border: #e2e8f0;
  --am-border-subtle: #f1f5f9;

  --am-sidebar-width: 260px;
  --am-header-height: 64px;
  --am-card-radius: 14px;
  --am-btn-radius: 8px;
  --am-input-radius: 8px;

  --am-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --am-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --am-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --am-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --am-glow: 0 0 20px rgba(79, 70, 229, 0.15);

  --am-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --am-transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --am-bg: #090d16;
  --am-surface: #111726;
  --am-surface-subtle: #172033;
  --am-surface-hover: #1c273e;
  --am-text: #f8fafc;
  --am-text-muted: #94a3b8;
  --am-text-faint: #64748b;
  --am-border: #1e293b;
  --am-border-subtle: #182234;
  --am-primary-light: rgba(99, 102, 241, 0.15);
  --am-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --am-shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.45);
  --am-glow: 0 0 25px rgba(99, 102, 241, 0.25);
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --am-bg: #090d16;
    --am-surface: #111726;
    --am-surface-subtle: #172033;
    --am-surface-hover: #1c273e;
    --am-text: #f8fafc;
    --am-text-muted: #94a3b8;
    --am-text-faint: #64748b;
    --am-border: #1e293b;
    --am-border-subtle: #182234;
    --am-primary-light: rgba(99, 102, 241, 0.15);
    --am-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --am-shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.45);
    --am-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  }
}

/* ==========================================================================
   RESET & SUPPRESSION OF LEGACY AMEMBER TOOLBARS
   ========================================================================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--am-bg);
  color: var(--am-text);
  font-family: var(--am-font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Completely suppress legacy horizontal tabs bar */
.am-account-toolbar,
.am-header-menu-wrapper,
.am-tabs-wrapper,
.am-tabs-narrow,
.am-tabs-narrow-switch,
.am-tabs-narrow-dashboard {
  display: none !important;
}

a {
  color: var(--am-primary);
  text-decoration: none;
  transition: var(--am-transition);
}
a:hover {
  color: var(--am-primary-hover);
}

/* ==========================================================================
   MASTER 2-COLUMN APPLICATION LAYOUT (SIDEBAR + MAIN)
   ========================================================================== */
.am-app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  background-color: var(--am-bg);
}

/* Mobile Sidebar Backdrop */
.am-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.am-sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Fixed Left Sidebar */
.am-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  width: var(--am-sidebar-width);
  background: var(--am-surface);
  border-right: 1px solid var(--am-border);
  display: flex;
  flex-direction: column;
  z-index: 90;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar Brand Header */
.am-sidebar-header {
  height: var(--am-header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--am-border);
  flex-shrink: 0;
}
.am-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--am-text);
}
.am-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--am-primary), var(--am-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.am-brand-text {
  display: flex;
  align-items: center;
  gap: 6px;
}
.am-brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.am-brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--am-primary-light);
  color: var(--am-primary);
  padding: 2px 6px;
  border-radius: 4px;
}

.am-sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--am-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

/* Scrollable Nav Items */
.am-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.am-sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.am-sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--am-border);
  border-radius: 10px;
}

.am-nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--am-text-faint);
  padding: 10px 12px 6px;
  margin-top: 4px;
}

/* Direct Navigation Item */
.am-nav-item {
  width: 100%;
}
.am-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--am-btn-radius);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--am-text-muted);
  text-decoration: none;
  transition: var(--am-transition);
}
.am-nav-link:hover {
  background: var(--am-surface-subtle);
  color: var(--am-text);
}
.am-nav-item.active .am-nav-link {
  background: var(--am-primary-light);
  color: var(--am-primary);
  font-weight: 700;
}

/* Expandable Accordion Menu Group */
.am-nav-group {
  width: 100%;
}
.am-nav-group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--am-btn-radius);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--am-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--am-transition);
  font-family: inherit;
}
.am-nav-group-btn:hover {
  background: var(--am-surface-subtle);
  color: var(--am-text);
}
.am-nav-group.expanded .am-nav-group-btn {
  color: var(--am-text);
  font-weight: 700;
}
.am-nav-group.active > .am-nav-group-btn {
  color: var(--am-text);
  font-weight: 700;
}
.am-nav-group.active > .am-nav-group-btn .am-nav-icon {
  color: var(--am-primary);
}
.am-nav-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.am-nav-icon {
  width: 16px;
  height: 16px;
  color: inherit;
  flex-shrink: 0;
}
.am-nav-arrow {
  width: 14px;
  height: 14px;
  color: var(--am-text-faint);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.am-nav-group.expanded .am-nav-arrow {
  transform: rotate(90deg);
  color: var(--am-primary);
}

/* Submenu Items List */
.am-nav-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 20px;
  margin-top: 3px;
  margin-bottom: 6px;
  border-left: 2px solid var(--am-border);
  margin-left: 18px;
}
.am-nav-group.expanded .am-nav-submenu {
  display: flex;
  animation: amSubmenuSlide 0.18s ease;
}
@keyframes amSubmenuSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.am-subnav-link {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--am-text-muted);
  text-decoration: none;
  transition: var(--am-transition);
}
.am-subnav-link:hover {
  color: var(--am-text);
  background: var(--am-surface-subtle);
}
.am-subnav-link.active {
  color: var(--am-primary);
  font-weight: 700;
  background: var(--am-primary-light);
}
/* Submenu item icons: same family as the main menu icons, scaled to the 13px label */
.am-subnav-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-right: 9px;
  color: var(--am-text-faint);
  stroke-width: 2;
  transition: var(--am-transition);
}
.am-subnav-link:hover .am-subnav-icon {
  color: var(--am-text);
}
.am-subnav-link.active .am-subnav-icon {
  color: var(--am-primary);
}

/* Sidebar Footer User Card */
.am-sidebar-footer {
  position: relative;
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--am-border);
  background: var(--am-surface);
  flex-shrink: 0;
  z-index: 10;
}
.am-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  user-select: none;
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
}
.am-sidebar-user:hover,
.am-sidebar-user[aria-expanded="true"] {
  background: var(--am-surface-subtle);
  border-color: var(--am-border);
}
.am-sidebar-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--am-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.am-sidebar-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.am-sidebar-avatar-blank {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--am-surface-subtle);
  color: var(--am-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.am-avatar-verified-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.am-sidebar-user-chevron {
  color: var(--am-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  margin-left: auto;
}
.am-sidebar-user[aria-expanded="true"] .am-sidebar-user-chevron {
  transform: rotate(180deg);
  color: var(--am-primary);
}
.am-sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.am-sidebar-user-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--am-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-sidebar-user-email {
  display: block;
  font-size: 11px;
  color: var(--am-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar User Profile Floating Menu */
.am-sidebar-user-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 10px;
  right: 10px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: 12px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.16), 0 6px 12px -2px rgba(0, 0, 0, 0.08);
  padding: 8px;
  z-index: 100;
  display: none;
  max-height: 80vh;
  overflow-y: auto;
}
.am-sidebar-user-menu.show {
  display: block;
  animation: amMenuPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header User Profile Trigger & Menu (Visible on phone and desktop) */
.am-header-user-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.am-header-user-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.am-header-user-btn:hover,
.am-header-user-btn[aria-expanded="true"] {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--am-primary);
}
.am-header-avatar {
  width: 34px !important;
  height: 34px !important;
}
.am-header-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: 12px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.16), 0 6px 12px -2px rgba(0, 0, 0, 0.08);
  padding: 8px;
  z-index: 100;
  display: none;
  max-height: 80vh;
  overflow-y: auto;
}
.am-header-user-menu.show {
  display: block;
  animation: amMenuPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes amMenuPop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.am-user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px 8px;
}
.am-user-menu-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}
.am-user-menu-info {
  flex: 1;
  min-width: 0;
}
.am-user-menu-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--am-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-user-menu-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 3px;
}
[data-theme="dark"] .am-user-menu-badge {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
}
.am-user-menu-divider {
  height: 1px;
  background: var(--am-border);
  margin: 6px 0;
}
.am-user-menu-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.am-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--am-text);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}
.am-user-menu-item:hover {
  background: var(--am-surface-subtle);
  color: var(--am-primary);
  text-decoration: none;
}
.am-user-menu-item.active {
  background: var(--am-primary-light);
  color: var(--am-primary);
  font-weight: 700;
}
.am-user-menu-item.active .am-user-menu-icon {
  color: var(--am-primary);
}
.am-user-menu-icon {
  width: 15px;
  height: 15px;
  color: var(--am-text-muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.am-user-menu-item:hover .am-user-menu-icon {
  color: var(--am-primary);
}
.am-user-menu-logout {
  color: #ef4444 !important;
}
.am-user-menu-logout:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
}
.am-user-menu-logout .am-user-menu-icon {
  color: #ef4444 !important;
}
.am-sidebar-logout {
  color: var(--am-text-muted);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--am-transition);
}
.am-sidebar-logout:hover {
  color: var(--am-danger);
  background: rgba(239, 68, 68, 0.1);
}
.am-header-logout:hover {
  color: #dc2626 !important;
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* ==========================================================================
   RIGHT MAIN APPLICATION WRAPPER & COMPACT HEADER
   ========================================================================== */
.am-app-main {
  margin-left: var(--am-sidebar-width);
  width: calc(100% - var(--am-sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--am-bg);
}

/* Compact Top Utility Header */
.am-app-header {
  height: var(--am-header-height);
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--am-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
[data-theme="dark"] .am-app-header,
[data-theme="system"] .am-app-header {
  background: rgba(17, 23, 38, 0.85);
}

.am-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}
.am-hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--am-border);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--am-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Brand in the header: only while the sidebar is off-canvas (see the 1024px breakpoint) */
.am-header-brand {
  display: none;
  min-width: 0;
}
.am-header-brand .am-brand-text {
  min-width: 0;
}
.am-header-brand .am-brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.am-utility-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  color: var(--am-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--am-transition);
}
.am-utility-btn:hover {
  color: var(--am-text);
  border-color: var(--am-text-muted);
}
.am-header-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--am-text);
}
.am-user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--am-success);
}

/* Page Body Content */
.am-app-content {
  flex: 1;
  padding: 24px 32px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Footer */
.am-app-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--am-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--am-text-muted);
  background: var(--am-surface);
}
.am-app-footer a {
  font-weight: 600;
}

/* ==========================================================================
   CARDS, BUTTONS, BADGES, & FORMS
   ========================================================================== */
.dash-card {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-card-radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--am-shadow-sm);
  transition: var(--am-transition);
}
.dash-card:hover {
  box-shadow: var(--am-shadow-md);
}

.am-2fa-grid {
  display: grid;
  /* one card fills the row, two cards sit side by side */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
  width: 100%;
}
.am-2fa-grid > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   UNIVERSAL BUTTON COMPONENT (.btn)
   Works identically on <a>, <button>, and <input[type="submit/button"]>
   ========================================================================== */
.btn,
a.btn,
button.btn,
input[type="button"].btn,
input[type="submit"].btn,
.am-body-content .btn,
.am-body-content a.btn,
.am-body-content button.btn,
.am-body-content input[type="button"].btn,
.am-body-content input[type="submit"].btn,
.am-form .btn,
.am-form button.btn,
.am-form input[type="submit"].btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  line-height: 1.42 !important;
  padding: 8px 16px !important;
  margin: 0 !important;
  border-radius: var(--am-btn-radius, 10px) !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  transition: var(--am-transition, all 0.15s ease) !important;
  text-decoration: none !important;
  text-align: center !important;
  white-space: nowrap !important;
  background-image: none !important;
  box-sizing: border-box !important;
  outline: none !important;
  vertical-align: middle !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

.btn:disabled,
button.btn:disabled,
input[type="submit"].btn:disabled,
.btn.disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Primary Button (.btn-primary) */
.btn-primary,
a.btn-primary,
button.btn-primary,
input[type="submit"].btn-primary,
.am-body-content .btn-primary,
.am-body-content a.btn-primary,
.am-body-content button.btn-primary,
.am-body-content input[type="submit"].btn-primary,
.am-form .btn-primary,
.am-form button.btn-primary,
.am-form input[type="submit"].btn-primary {
  background-color: var(--am-primary) !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25) !important;
}
.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover,
input[type="submit"].btn-primary:hover,
.am-body-content .btn-primary:hover,
.am-body-content a.btn-primary:hover,
.am-body-content button.btn-primary:hover,
.am-body-content input[type="submit"].btn-primary:hover,
.am-form .btn-primary:hover,
.am-form button.btn-primary:hover,
.am-form input[type="submit"].btn-primary:hover {
  background-color: var(--am-primary-hover) !important;
  background-image: none !important;
  border-color: transparent !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}
.btn-primary:active,
a.btn-primary:active,
button.btn-primary:active,
input[type="submit"].btn-primary:active,
.am-body-content .btn-primary:active,
.am-body-content a.btn-primary:active,
.am-body-content button.btn-primary:active,
.am-body-content input[type="submit"].btn-primary:active {
  background-color: var(--am-primary-hover) !important;
  background-image: none !important;
  transform: translateY(0);
}

/* Secondary Button (.btn-secondary) */
.btn-secondary,
a.btn-secondary,
button.btn-secondary,
input[type="button"].btn-secondary,
.am-body-content .btn-secondary,
.am-body-content a.btn-secondary,
.am-body-content button.btn-secondary,
.am-body-content input[type="button"].btn-secondary,
.am-form .btn-secondary,
.am-form button.btn-secondary,
.am-form input[type="button"].btn-secondary {
  background-color: var(--am-surface) !important;
  background-image: none !important;
  color: var(--am-text) !important;
  border-color: var(--am-border) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
.btn-secondary:hover,
a.btn-secondary:hover,
button.btn-secondary:hover,
input[type="button"].btn-secondary:hover,
.am-body-content .btn-secondary:hover,
.am-body-content a.btn-secondary:hover,
.am-body-content button.btn-secondary:hover,
.am-body-content input[type="button"].btn-secondary:hover,
.am-form .btn-secondary:hover,
.am-form button.btn-secondary:hover,
.am-form input[type="button"].btn-secondary:hover {
  background-color: var(--am-surface-subtle) !important;
  background-image: none !important;
  color: var(--am-text) !important;
  border-color: var(--am-text-muted) !important;
}

/* Accent Button (.btn-accent) */
.btn-accent,
a.btn-accent,
button.btn-accent,
.am-body-content .btn-accent,
.am-body-content a.btn-accent,
.am-body-content button.btn-accent {
  background: linear-gradient(135deg, var(--am-primary), var(--am-accent)) !important;
  background-image: linear-gradient(135deg, var(--am-primary), var(--am-accent)) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.btn-accent:hover,
a.btn-accent:hover,
button.btn-accent:hover,
.am-body-content .btn-accent:hover,
.am-body-content a.btn-accent:hover,
.am-body-content button.btn-accent:hover {
  filter: brightness(1.06);
}

/* Danger Button (.btn-danger) */
.btn-danger,
a.btn-danger,
button.btn-danger,
.am-body-content .btn-danger,
.am-body-content a.btn-danger,
.am-body-content button.btn-danger {
  background-color: #ef4444 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: transparent !important;
}
.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover,
.am-body-content .btn-danger:hover,
.am-body-content a.btn-danger:hover,
.am-body-content button.btn-danger:hover {
  background-color: #dc2626 !important;
  background-image: none !important;
  color: #ffffff !important;
}

/* Button Sizes */
.btn-sm,
a.btn-sm,
button.btn-sm,
.am-body-content .btn-sm,
.am-body-content a.btn-sm,
.am-body-content button.btn-sm {
  padding: 6px 12px !important;
  font-size: 12.5px !important;
}
.btn-lg,
a.btn-lg,
button.btn-lg,
.am-body-content .btn-lg,
.am-body-content a.btn-lg,
.am-body-content button.btn-lg {
  padding: 11px 22px !important;
  font-size: 15px !important;
  border-radius: 10px !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-pill {
  background: var(--am-primary-light);
  color: var(--am-primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}
.badge-accent {
  background: rgba(6, 182, 212, 0.12);
  color: var(--am-accent);
}
.badge-free {
  background: rgba(16, 185, 129, 0.12);
  color: var(--am-success);
}

/* Theme Switcher Toggle */
.am-theme-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  border-radius: 20px;
  padding: 3px;
  cursor: pointer;
}
.am-theme-btn {
  background: transparent;
  border: none;
  padding: 4px 7px;
  border-radius: 16px;
  color: var(--am-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: var(--am-transition);
}
.am-theme-btn.active {
  background: var(--am-surface);
  color: var(--am-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Form Controls */
.am-form input[type="text"],
.am-form input[type="password"],
.am-form input[type="email"],
.am-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--am-border);
  border-radius: var(--am-input-radius);
  background: var(--am-surface);
  color: var(--am-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--am-transition);
}
.am-form select {
  width: 100%;
  border: 1px solid var(--am-border);
  border-radius: var(--am-input-radius);
  background: var(--am-surface);
  color: var(--am-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--am-transition);
}
.am-form input:focus, .am-form select:focus, .am-form textarea:focus {
  border-color: var(--am-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ==========================================================================
   MEMBER DASHBOARD WIDGETS & 2-COLUMN GRID
   ========================================================================== */
.am-layout-two-coll {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 16px 0 !important;
}
.am-layout-two-coll .am-layout-two-coll-top,
.am-layout-two-coll .am-layout-two-coll-bottom {
  display: none !important;
}
.am-layout-two-coll .am-coll-left,
.am-layout-two-coll .am-coll-right {
  float: none !important;
  width: 100% !important;
}
.am-layout-two-coll .am-coll-left .am-coll-content,
.am-layout-two-coll .am-coll-right .am-coll-content {
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (max-width: 900px) {
  .am-layout-two-coll {
    grid-template-columns: 1fr;
  }
}

.am-widget {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-card-radius);
  padding: 24px;
  box-shadow: var(--am-shadow-sm);
  transition: var(--am-transition);
}
.am-widget:hover {
  box-shadow: var(--am-shadow-md);
}
.am-widget h2 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--am-border-subtle);
  color: var(--am-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modern Data Grids */
.am-grid-container {
  overflow-x: auto;
  border: 1px solid var(--am-border);
  border-radius: var(--am-card-radius);
  background: var(--am-surface);
  margin-top: 14px;
}
.am-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.am-grid th {
  background: var(--am-surface-subtle);
  color: var(--am-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--am-border);
  text-align: left;
}
.am-grid td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--am-border-subtle);
  color: var(--am-text);
}
.am-grid tr:last-child td {
  border-bottom: none;
}
.am-grid tr:hover td {
  background: var(--am-surface-subtle);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.tool-card {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-card-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--am-transition);
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: var(--am-shadow-md);
}
.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.tool-icon-box {
  aspect-ratio: 29 / 14;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--am-text, #1e293b);
  background: #ffffff !important;
  border: 1px solid var(--am-border, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  overflow: hidden;
}
.tool-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tool-meta {
  flex: 1;
}
.tool-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}
.tool-tagline {
  font-size: 13px;
  color: var(--am-text-muted);
  line-height: 1.4;
  margin: 0;
}
.tool-description {
  font-size: 13.5px;
  color: var(--am-text-muted);
  margin: 10px 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--am-border-subtle);
}

/* Category Pills */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}
.cat-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  color: var(--am-text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--am-transition);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--am-primary);
  color: #fff;
  border-color: var(--am-primary);
}

/* 2-Column Checkout Wrapper */
.checkout-wrapper {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  margin: 24px 0 40px;
}
@media (max-width: 900px) {
  .checkout-wrapper {
    grid-template-columns: 1fr;
  }
}
.checkout-card {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-card-radius);
  padding: 28px;
}

/* ==========================================================================
   RESPONSIVE MOBILE BEHAVIOR
   ========================================================================== */
@media (max-width: 1024px) {
  .am-sidebar {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    left: calc(0px - var(--am-sidebar-width));
    box-shadow: none;
    display: flex !important;
    flex-direction: column !important;
  }
  .am-sidebar.open {
    transform: translateX(var(--am-sidebar-width));
    box-shadow: var(--am-shadow-xl);
  }
  .am-sidebar-close-btn {
    display: inline-flex;
  }
  .am-hamburger-btn {
    display: inline-flex;
  }
  .am-header-brand {
    display: flex;
  }
  .am-app-main {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: clip;
  }
  .am-app-header {
    padding: 0 16px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .am-app-content {
    padding: 20px 16px;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .am-app-footer {
    padding: 20px 16px;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 768px) {
  /* Prevent horizontal layout overflow */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .am-app-layout {
    max-width: 100vw !important;
    overflow-x: clip !important;
  }

  /* Compact & beautiful phone header */
  .am-app-header {
    padding: 0 12px !important;
    height: 56px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: visible !important;
  }
  .am-header-left {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    gap: 8px !important;
    overflow: hidden !important;
  }
  .am-hamburger-btn {
    padding: 5px 7px !important;
    flex-shrink: 0 !important;
  }
  .am-header-brand {
    gap: 8px !important;
  }
  .am-header-brand .am-brand-mark {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
  }
  .am-header-brand .am-brand-mark svg,
  .am-header-brand .am-brand-mark i {
    width: 16px !important;
    height: 16px !important;
  }
  .am-header-brand .am-brand-title {
    font-size: 15px !important;
  }
  .am-header-right {
    flex-shrink: 0 !important;
    gap: 6px !important;
  }
  .am-header-logout {
    display: none !important; /* Hide separate logout button on phone - use header user avatar menu */
  }
  .am-header-user-wrapper {
    display: none !important; /* profile lives in the sidebar footer on phones */
  }
  .am-theme-switcher {
    padding: 2px !important;
  }
  .am-theme-btn {
    padding: 3px 6px !important;
    font-size: 12px !important;
  }
  .am-color-picker-toggle {
    width: 32px !important;
    height: 32px !important;
  }

  /* Fixed Sidebar Drawer on Phone */
  .am-sidebar {
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 1000 !important;
  }
  .am-sidebar-nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 20px !important;
  }
  .am-sidebar-footer {
    flex-shrink: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 20 !important;
    padding: 12px 14px !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    background: var(--am-surface) !important;
  }
  .am-sidebar-user {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
  }
  .am-sidebar-user-menu {
    max-height: 70vh !important;
    overflow-y: auto !important;
  }

  /* Two-Step Verification & Dash Cards Grid on Phone */
  .am-2fa-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
  }
  .dash-card {
    padding: 20px 16px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Public header on phone */
  .am-public-header-inner {
    padding: 0 12px !important;
    gap: 8px !important;
  }
  .am-public-header-inner .am-brand-badge {
    display: none; /* room for the full site title next to icon-only actions */
  }
  .am-public-actions {
    gap: 6px !important;
  }
  .am-public-actions .btn {
    padding: 5px 9px !important;
    font-size: 12px !important;
  }
}

/* ==========================================================================
   PUBLIC VISITOR LAYOUT & HEADER (LOGGED OUT)
   ========================================================================== */
.am-layout-guest {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  width: 100% !important;
  position: relative;
  background-color: var(--am-bg);
}

.am-layout-guest .am-public-header {
  width: 100% !important;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0 !important;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--am-border);
}
[data-theme="dark"] .am-layout-guest .am-public-header,
[data-theme="system"] .am-layout-guest .am-public-header {
  background: rgba(17, 23, 38, 0.9);
}

.am-public-header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.am-public-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.am-public-nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--am-text-muted);
  text-decoration: none;
  transition: var(--am-transition);
  padding: 6px 4px;
  position: relative;
  white-space: nowrap;
}
.am-public-nav-link:hover {
  color: var(--am-text);
}
.am-public-nav-link.active {
  color: var(--am-primary);
}
.am-public-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--am-primary);
  border-radius: 2px;
}

.am-public-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.am-public-menu-btn {
  display: none;
}
/* "Sticky / Glassmorphism Floating Header" switched off in the theme settings */
.am-app-header.am-header-static,
.am-layout-guest .am-public-header.am-header-static {
  position: static;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.am-public-header-inner .am-brand {
  min-width: 0;
}
.am-public-header-inner .am-brand-text {
  min-width: 0;
}
.am-public-header-inner .am-brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-public-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.am-public-auth-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.am-layout-guest .am-guest-main {
  margin-left: 0 !important;
  width: 100% !important;
  flex: 1 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: auto !important;
}

.am-layout-guest .am-guest-content {
  flex: 1 0 auto !important;
  width: 100% !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 40px 24px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.am-layout-guest .am-app-footer {
  width: 100% !important;
  margin-top: auto !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* Public Mobile Drawer */
.am-public-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  bottom: 0;
  width: 280px;
  background: var(--am-surface);
  border-right: 1px solid var(--am-border);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none;
}
.am-public-drawer.open {
  transform: translateX(280px);
  box-shadow: var(--am-shadow-xl);
}
.am-public-drawer-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--am-border);
}
.am-public-drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.am-public-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--am-btn-radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--am-text-muted);
  text-decoration: none;
  transition: var(--am-transition);
}
.am-public-drawer-link:hover {
  background: var(--am-surface-subtle);
  color: var(--am-text);
}
.am-public-drawer-link.active {
  background: var(--am-primary-light);
  color: var(--am-primary);
  font-weight: 700;
}
.am-public-drawer-footer {
  padding: 16px;
  border-top: 1px solid var(--am-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 900px) {
  .am-public-nav {
    display: none;
  }
  .am-public-menu-btn {
    display: inline-flex;
  }
  .am-public-header-inner {
    padding: 0 16px;
  }
  /* Dashboard / Logout become icon-only buttons */
  .am-public-auth-label {
    display: none;
  }
  .am-public-actions .am-public-auth-btn {
    padding: 7px !important;
    gap: 0;
    width: 34px;
    height: 34px;
    justify-content: center;
    border-radius: 8px;
  }
  .am-public-auth-icon {
    width: 16px;
    height: 16px;
  }
}

/* ==========================================================================
   AUTHENTICATION PAGES (LOGIN / REGISTRATION / PASSWORD RESET)
   ========================================================================== */
.am-auth-layout-shell {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  box-sizing: border-box;
}

.am-auth-card {
  width: 100%;
  max-width: 940px;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-card-radius);
  overflow: hidden;
  box-shadow: var(--am-shadow-xl);
  margin: 0 auto;
}

@media (max-width: 800px) {
  .am-auth-card {
    grid-template-columns: 1fr;
  }
  .am-auth-card-sidebar {
    display: none;
  }
}

.am-auth-card-sidebar {
  background: linear-gradient(135deg, var(--am-primary), var(--am-accent));
  padding: 44px 36px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.am-auth-card-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.am-auth-card-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.am-auth-card-heading {
  font-size: 26px;
  line-height: 1.3;
  color: #ffffff;
  margin: 0 0 16px;
  font-weight: 800;
}

.am-auth-card-subheading {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
  margin: 0;
}

.am-auth-card-badge {
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.am-auth-card-form {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--am-surface);
}

.am-auth-form-header {
  margin-bottom: 24px;
}

/* Eliminate core white box from aMember's form templates */
.am-auth-card-form .am-form form,
.am-auth-card-form form,
.am-login-form-wrap form,
.am-login-form form,
.am-sendpass-form form {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.am-auth-card-form fieldset,
.am-login-form-wrap fieldset {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.am-auth-card-form fieldset legend,
.am-login-form-wrap fieldset legend {
  display: none !important;
}

.am-auth-card-form .am-row,
.am-login-form-wrap .am-row {
  background: transparent !important;
  border: none !important;
  padding: 8px 0 !important;
  margin: 0 !important;
}

.am-auth-card-form .am-element-title,
.am-login-form-wrap .am-element-title {
  background: transparent !important;
  color: var(--am-text) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  margin-bottom: 6px !important;
  padding: 0 !important;
  text-align: left !important;
}

.am-auth-card-form .am-element-title label,
.am-login-form-wrap .am-element-title label {
  color: var(--am-text) !important;
}

.am-auth-card-form input[type="text"],
.am-auth-card-form input[type="password"],
.am-login-form-wrap input[type="text"],
.am-login-form-wrap input[type="password"] {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 12px 14px !important;
  border: 1px solid var(--am-border) !important;
  border-radius: var(--am-input-radius) !important;
  background: var(--am-surface-subtle) !important;
  color: var(--am-text) !important;
  font-size: 14px !important;
  font-family: inherit !important;
  outline: none !important;
  transition: var(--am-transition) !important;
}

.am-auth-card-form input[type="text"]:focus,
.am-auth-card-form input[type="password"]:focus,
.am-login-form-wrap input[type="text"]:focus,
.am-login-form-wrap input[type="password"]:focus {
  border-color: var(--am-primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2) !important;
  background: var(--am-surface) !important;
}

.am-auth-card-form input[type="submit"],
.am-login-form-wrap input[type="submit"] {
  width: 100% !important;
  padding: 12px 20px !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  border-radius: var(--am-btn-radius) !important;
  background: var(--am-primary) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  transition: var(--am-transition) !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
  margin-top: 10px !important;
}

.am-auth-card-form input[type="submit"]:hover,
.am-login-form-wrap input[type="submit"]:hover {
  background: var(--am-primary-hover) !important;
  transform: translateY(-1px) !important;
}

.am-auth-card-form .am-form-login-switch-wrapper,
.am-login-form-wrap .am-form-login-switch-wrapper {
  display: block !important;
  text-align: center !important;
  margin-top: 14px !important;
  margin-left: 0 !important;
}

.am-auth-card-form .am-form-login-switch-wrapper a,
.am-login-form-wrap .am-form-login-switch-wrapper a {
  color: var(--am-primary) !important;
  font-size: 13px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
}

.am-auth-card-form .am-form-login-switch-wrapper a:hover,
.am-login-form-wrap .am-form-login-switch-wrapper a:hover {
  text-decoration: underline !important;
}

.am-auth-card-form .am-signup-link,
.am-login-form-wrap .am-signup-link {
  margin-top: 20px !important;
  text-align: center !important;
  font-size: 13.5px !important;
  color: var(--am-text-muted) !important;
}

.am-auth-card-form .am-signup-link a,
.am-login-form-wrap .am-signup-link a {
  color: var(--am-primary) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}
.am-auth-card-form .am-signup-link a:hover,
.am-login-form-wrap .am-signup-link a:hover {
  text-decoration: underline !important;
}

/* ==========================================================================
   GLOBAL FORM RESETS & DARK MODE STYLING FOR AMEMBER
   ========================================================================== */
.am-form,
.am-form form,
.am-signup form,
.am-signup-form {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--am-text) !important;
}

.am-form fieldset,
.am-signup fieldset {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.am-form fieldset legend,
.am-signup fieldset legend {
  width: 100% !important;
  display: block !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--am-text) !important;
  background: transparent !important;
  border-bottom: 1px solid var(--am-border) !important;
  padding: 0 0 10px 0 !important;
  margin-bottom: 16px !important;
}

/* Eliminate legacy 35% float column layout for clean, responsive vertical fields */
.am-form .am-row,
.am-signup .am-row {
  display: flex !important;
  flex-direction: column !important;
  float: none !important;
  width: 100% !important;
  border: none !important;
  background: transparent !important;
  padding: 8px 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
/* rows hidden by aMember scripts (e.g. payout method fields) must stay hidden despite the !important above */
.am-form .am-row[style*="display: none"],
.am-form .am-row[style*="display:none"],
.am-signup .am-row[style*="display: none"],
.am-signup .am-row[style*="display:none"] {
  display: none !important;
}

/* Hide redundant labels when input fields already have placeholders */
.am-signup .am-row:not(#row-product_id_page-0-0):not(#row-paysys_id) .am-element-title label,
.am-auth-card-form .am-row .am-element-title label {
  display: none !important;
}
.am-signup .am-row:not(#row-product_id_page-0-0):not(#row-paysys_id) .am-element-title {
  margin-bottom: 0 !important;
  padding: 0 !important;
}

/* Auto-generate username setting: hide username field when enabled */
.am-auto-username #row-login-0,
.am-auto-username #row-login,
.am-auto-username [id^="row-login"] {
  display: none !important;
}

/* Suppress redundant standalone header on signup page */
.am-page-signup .am-body-content-top {
  display: none !important;
}

.am-form .am-element-title,
.am-signup .am-element-title {
  float: none !important;
  width: 100% !important;
  text-align: left !important;
  padding: 0 !important;
  margin-bottom: 6px !important;
  background: transparent !important;
  color: var(--am-text) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
}

.am-form .am-element-title label,
.am-signup .am-element-title label {
  color: var(--am-text) !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.am-form .am-element,
.am-signup .am-element {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.am-form .comment,
.am-signup .comment {
  font-size: 11.5px !important;
  color: var(--am-text-muted) !important;
  margin-top: 4px !important;
  line-height: 1.4 !important;
}

/* Password Box Full Width (Fix am-pass-indicator-wrap) */
.am-pass-indicator-wrap {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  position: relative !important;
  box-sizing: border-box !important;
}
.am-pass-indicator-wrap input,
.am-pass-indicator-wrap input.am-pass-indicator {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* First & Last Name group flex alignment */
.am-form .am-element.group,
.am-signup .am-element.group {
  display: flex !important;
  gap: 12px !important;
  width: 100% !important;
}
.am-form .am-element.group input,
.am-signup .am-element.group input {
  flex: 1 !important;
}
@media (max-width: 640px) {
  .am-form .am-element.group,
  .am-signup .am-element.group {
    flex-direction: column !important;
    gap: 8px !important;
  }
}

/* Universal Inputs & Textareas */
.am-form input[type="text"],
.am-form input[type="password"],
.am-form input[type="email"],
.am-form select,
.am-form textarea,
.am-signup input[type="text"],
.am-signup input[type="password"],
.am-signup input[type="email"],
.am-signup select,
.am-signup textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 12px 14px !important;
  border: 1px solid var(--am-border) !important;
  border-radius: var(--am-input-radius) !important;
  background: var(--am-surface-subtle) !important;
  color: var(--am-text) !important;
  font-size: 14px !important;
  font-family: inherit !important;
  outline: none !important;
  transition: var(--am-transition) !important;
}

.am-form input[type="text"]:focus,
.am-form input[type="password"]:focus,
.am-form input[type="email"]:focus,
.am-form select:focus,
.am-form textarea:focus,
.am-signup input[type="text"]:focus,
.am-signup input[type="password"]:focus,
.am-signup input[type="email"]:focus,
.am-signup select:focus,
.am-signup textarea:focus {
  border-color: var(--am-primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2) !important;
  background: var(--am-surface) !important;
}

/* Universal Submit Buttons */
.am-form input[type="submit"],
.am-signup input[type="submit"],
.am-cta-signup {
  width: 100% !important;
  padding: 14px 28px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: var(--am-btn-radius) !important;
  background: linear-gradient(135deg, var(--am-primary), var(--am-primary-hover)) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  transition: var(--am-transition) !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
  margin-top: 12px !important;
  font-family: inherit !important;
  text-align: center !important;
}

.am-form input[type="submit"]:hover,
.am-signup input[type="submit"]:hover,
.am-cta-signup:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45) !important;
}

/* ==========================================================================
   MODERN SAAS SIGNUP SPLIT ONBOARDING EXPERIENCE
   ========================================================================== */
.am-signup-split-shell {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 60px;
  box-sizing: border-box;
}

.am-signup-split-container {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 1.15fr 1.35fr;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--am-shadow-xl);
  margin: 0 auto;
}

/* Left Showcase Panel */
.am-signup-showcase {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(6, 182, 212, 0.9));
  padding: 48px 40px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.am-signup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.am-signup-showcase-title {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 16px;
}

.am-signup-showcase-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 32px;
}

.am-signup-perks {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.am-signup-perk-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.am-perk-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}

.am-perk-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.am-perk-text span {
  display: block;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

.am-signup-showcase-bottom {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.am-signup-testimonial {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 18px 20px;
}

.am-testimonial-rating {
  color: #facc15;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.am-testimonial-quote {
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 8px;
}

.am-testimonial-author strong {
  display: block;
  font-size: 12px;
  color: #ffffff;
}

.am-testimonial-author span {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}

.am-signup-guarantee {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* Right Form Card */
.am-signup-form-card {
  padding: 48px;
  display: flex;
  flex-direction: column;
  background: var(--am-surface);
}

.am-signup-card-header {
  margin-bottom: 24px;
}

.am-step-indicator {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--am-primary);
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.am-signup-card-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--am-text);
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.am-signup-card-subtitle {
  font-size: 13.5px;
  color: var(--am-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Login Offer Pill */
.am-signup-login-pill {
  margin-bottom: 20px;
}
.am-signup-login-pill .am-info.am-login-text {
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--am-text-muted);
}
.am-signup-login-pill .am-info.am-login-text a {
  color: var(--am-primary);
  font-weight: 700;
  text-decoration: none;
}
.am-signup-login-pill .am-info.am-login-text a:hover {
  text-decoration: underline;
}

/* Membership Plan Selection Card */
#row-product_id_page-0-0 {
  background: var(--am-surface-subtle) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  margin-bottom: 16px !important;
}

#row-product_id_page-0-0 .am-element-title {
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  color: var(--am-text-faint) !important;
  margin-bottom: 10px !important;
}

.am-product-title {
  display: block;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: var(--am-text) !important;
  margin-bottom: 4px !important;
}

.am-product-terms {
  display: inline-block;
  background: var(--am-primary-light);
  color: var(--am-primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px !important;
  font-weight: 700 !important;
  margin: 4px 0 8px !important;
}

.am-product-desc {
  display: block;
  font-size: 12.5px !important;
  color: var(--am-text-muted) !important;
  line-height: 1.4 !important;
}

/* Payment system preview */
#row-paysys_id {
  background: var(--am-surface-subtle) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 10px !important;
  padding: 12px 18px !important;
  margin-bottom: 16px !important;
}
.am-paysystem-title {
  font-weight: 700;
  color: var(--am-text);
  font-size: 14px;
}
.am-paysystem-desc {
  font-size: 12px;
  color: var(--am-text-muted);
  margin-left: 8px;
}

/* Security Trust Badges Strip */
.am-signup-security-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--am-border-subtle);
  flex-wrap: wrap;
}

.am-sec-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--am-text-muted);
  font-weight: 600;
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVENESS (ALL DEVICES & PAGES)
   ========================================================================== */

/* Tablets & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .am-signup-split-container {
    grid-template-columns: 1fr;
    max-width: 680px;
  }
  .am-signup-showcase {
    padding: 36px 32px;
  }
  .am-signup-showcase-desc {
    margin-bottom: 20px;
  }
  .am-signup-perks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .am-signup-form-card {
    padding: 36px 32px;
  }
}

/* Mobile Screens (<= 640px) */
@media (max-width: 640px) {
  .am-signup-split-container {
    border-radius: 14px;
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .am-signup-showcase {
    border-radius: 14px;
    padding: 28px 20px;
    margin-bottom: 16px;
  }
  .am-signup-showcase-title {
    font-size: 22px;
  }
  .am-signup-perks {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .am-signup-showcase-bottom {
    margin-top: 24px;
  }
  .am-signup-form-card {
    border-radius: 14px;
    border: 1px solid var(--am-border);
    padding: 28px 20px;
    box-shadow: var(--am-shadow-md);
  }
  .am-signup-card-title {
    font-size: 20px;
  }
  .am-signup-security-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .am-public-header-inner {
    padding: 0 16px;
  }
  .am-guest-content {
    padding: 20px 16px !important;
  }
}

/* ====================================================================
   SUPPRESS REDUNDANT DEFAULT aMEMBER TITLES
   ==================================================================== */
.am-body-content-top {
  display: none !important;
}

/* ====================================================================
   USER ACCENT COLOR PICKER DROPDOWN
   ==================================================================== */
.am-color-picker-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.am-color-picker-toggle {
  position: relative;
}
.am-active-color-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--am-primary);
  border: 1.5px solid var(--am-surface);
}
.am-color-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-md);
  padding: 12px 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1000;
}
.am-color-menu.open {
  display: block;
  animation: amFadeIn 0.15s ease-out;
}
.am-color-menu-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--am-text-muted);
  margin-bottom: 10px;
}
.am-color-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.am-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  padding: 0;
}
.am-color-swatch:hover {
  transform: scale(1.15);
}
.am-color-swatch.active {
  border-color: var(--am-text);
  box-shadow: 0 0 0 2px var(--am-surface);
}

/* ====================================================================
   MODERN FORM CARD (PROFILE, PAYOUT INFO, SETTINGS)
   ==================================================================== */
.am-form-card-container {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 8px 0 24px;
}
.am-form-card {
  width: 100%;
  max-width: 640px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-lg);
  padding: 32px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}
.am-form-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--am-border);
}
.am-form-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--am-primary), var(--am-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -2px rgba(var(--am-primary-rgb, 79,70,229), 0.35);
}
.am-form-card-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--am-text);
}
.am-form-card-subtitle {
  font-size: 13px;
  color: var(--am-text-muted);
  margin: 0;
}

/* Redesign .am-form elements inside .am-modern-form-wrapper & member content */
.am-modern-form-wrapper .am-form {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}
.am-modern-form-wrapper .am-form form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.am-modern-form-wrapper .am-row,
.am-page-profile .am-row,
.am-page-aff-payout-info .am-row {
  margin-bottom: 16px;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.am-modern-form-wrapper .am-row .am-element-title,
.am-page-profile .am-row .am-element-title,
.am-page-aff-payout-info .am-row .am-element-title {
  width: 100% !important;
  float: none !important;
  text-align: left !important;
  padding: 0 !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--am-text);
}
/* Hide element label if row has placeholder */
.am-row-has-placeholders > .am-element-title,
.am-page-profile #row-name-0 > .am-element-title,
.am-page-profile #row-email-0 > .am-element-title {
  display: none !important;
}
.am-modern-form-wrapper .am-row .am-element,
.am-page-profile .am-row .am-element,
.am-page-aff-payout-info .am-row .am-element {
  width: 100% !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.am-modern-form-wrapper .am-row .am-element.group,
.am-page-profile .am-row .am-element.group {
  display: flex;
  gap: 12px;
}
.am-modern-form-wrapper .am-row .am-element.group input,
.am-page-profile .am-row .am-element.group input {
  flex: 1;
}
.am-modern-form-wrapper input[type="text"],
.am-modern-form-wrapper input[type="password"],
.am-modern-form-wrapper input[type="email"],
.am-page-profile input[type="text"],
.am-page-profile input[type="password"],
.am-page-profile input[type="email"],
.am-page-aff-payout-info input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  border-radius: var(--am-radius-md);
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  color: var(--am-text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.am-modern-form-wrapper select,
.am-page-profile select,
.am-page-aff-payout-info select {
  width: 100%;
  height: 44px;
  border-radius: var(--am-radius-md);
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  color: var(--am-text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.am-modern-form-wrapper input:focus,
.am-modern-form-wrapper select:focus,
.am-page-profile input:focus,
.am-page-profile select:focus,
.am-page-aff-payout-info input:focus,
.am-page-aff-payout-info select:focus {
  border-color: var(--am-primary);
  box-shadow: 0 0 0 3px rgba(var(--am-primary-rgb, 79,70,229), 0.15);
}
.am-modern-form-wrapper input[type="submit"],
.am-page-profile input[type="submit"],
.am-page-aff-payout-info input[type="submit"] {
  width: 100%;
  height: 44px;
  border-radius: var(--am-radius-md);
  background: var(--am-primary);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-top: 8px;
}
.am-modern-form-wrapper input[type="submit"]:hover,
.am-page-profile input[type="submit"]:hover,
.am-page-aff-payout-info input[type="submit"]:hover {
  background: var(--am-primary-hover);
  transform: translateY(-1px);
}
.am-change-pass-toggle {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--am-primary);
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--am-radius-sm);
  background: rgba(var(--am-primary-rgb, 79,70,229), 0.08);
}
.am-change-pass-toggle:hover {
  background: rgba(var(--am-primary-rgb, 79,70,229), 0.15);
}

/* Profile Tabs & Form Mode Separation (Profile Details vs Security & Password) */
.am-profile-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--am-border);
  margin-bottom: 24px;
  padding-bottom: 12px;
  overflow-x: auto;
}
.am-profile-tab-btn {
  padding: 8px 18px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  color: var(--am-text-muted) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all 0.15s ease !important;
  outline: none !important;
}
.am-profile-tab-btn:hover {
  background: var(--am-surface-subtle) !important;
  color: var(--am-text) !important;
}
.am-profile-tab-btn.active {
  background: var(--am-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(var(--am-primary-rgb, 79,70,229), 0.3) !important;
}

/* Profile Mode: Personal Info Only (Name + Email + Phone), HIDE all password rows.
   Rows are picked by what they contain: auto-numbered ids (row-qfauto-N) shift when fields are added. */
.am-tab-mode-profile .am-row:has(.am-change-pass-toggle),
.am-tab-mode-profile #row-_oldpass-0,
.am-tab-mode-profile #row-pass-0,
.am-tab-mode-profile #row-pass-confirm {
  display: none !important;
}
.am-tab-mode-profile #row-name-0,
.am-tab-mode-profile #row-email-0,
.am-tab-mode-profile .am-row:has(#am-mobile-area),
.am-tab-mode-profile .am-row:has(.am-locked-phone) {
  display: block !important;
}

/* Security Mode: Password Fields Only, HIDE personal info & clumsy toggle link */
.am-tab-mode-security #row-name-0,
.am-tab-mode-security #row-email-0,
.am-tab-mode-security .am-row:has(#am-mobile-area),
.am-tab-mode-security .am-row:has(.am-locked-phone),
.am-tab-mode-security .am-row:has(.am-change-pass-toggle) {
  display: none !important;
}
.am-tab-mode-security #row-_oldpass-0,
.am-tab-mode-security #row-pass-0,
.am-tab-mode-security #row-pass-confirm {
  display: block !important;
}
.am-tab-mode-security .am-change-pass {
  display: block !important;
}
.am-tab-mode-security input[type="password"] {
  display: block !important;
}

/* Dedicated Modern SaaS Company Info Utility Button */
.am-btn-company-edit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 36px !important;
  padding: 0 16px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  color: var(--am-text) !important;
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease-in-out !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  outline: none !important;
  vertical-align: middle !important;
}
.am-btn-company-edit:hover {
  background: var(--am-surface-subtle) !important;
  border-color: var(--am-primary) !important;
  color: var(--am-primary) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
.am-btn-company-edit i,
.am-btn-company-edit svg {
  color: var(--am-primary) !important;
  stroke: var(--am-primary) !important;
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
}

.am-company-form input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  border-radius: var(--am-radius-md);
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  color: var(--am-text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.am-company-form select {
  width: 100%;
  height: 44px;
  border-radius: var(--am-radius-md);
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  color: var(--am-text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.am-company-form input[type="text"]:focus,
.am-company-form select:focus {
  border-color: var(--am-primary);
  box-shadow: 0 0 0 3px rgba(var(--am-primary-rgb, 79,70,229), 0.15);
}

/* Modal Dialog Animations & Backdrop */
.am-modal-overlay {
  animation: amFadeIn 0.2s ease-out;
}
.am-modal-dialog {
  animation: amModalSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes amModalSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   MODERN SAAS SWITCH TOGGLE
   ========================================================================== */
.am-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.am-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.am-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--am-border);
  transition: .2s;
  border-radius: 24px;
}
.am-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.am-switch input:checked + .am-switch-slider {
  background-color: var(--am-primary);
}
.am-switch input:checked + .am-switch-slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   MODERN SAAS CART & BASKET STYLES
   ========================================================================== */
.am-cart-shell {
  width: 100%;
}
.am-cart {
  display: flex !important;
  gap: 28px !important;
  align-items: flex-start !important;
  margin-top: 10px !important;
}
.am-cart.am-cart-nosidebar .am-cart-main {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}
.am-cart-main {
  flex: 1 !important;
  min-width: 0 !important;
  float: none !important;
  width: auto !important;
  padding-right: 0 !important;
}
.am-cart-sidebar {
  width: 300px !important;
  flex-shrink: 0 !important;
  float: none !important;
}

/* Product list grid in Cart - 4 Columns in 1 Line */
.am-cart-layout-product-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
@media (max-width: 1200px) {
  .am-cart-layout-product-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 860px) {
  .am-cart-layout-product-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 540px) {
  .am-cart-layout-product-list {
    grid-template-columns: 1fr !important;
  }
}

/* Combo Packages Grid */
.am-cart-combo-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: stretch !important;
}
@media (max-width: 1080px) {
  .am-cart-combo-grid {
    grid-template-columns: 1fr !important;
  }
}
.am-cart-combo-card {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
}
.am-cart-combo-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 32px -6px rgba(0,0,0,0.1) !important;
}
.am-cart-combo-card-featured {
  background: linear-gradient(180deg, var(--am-surface) 0%, rgba(var(--am-primary-rgb, 79,70,229), 0.03) 100%) !important;
}
.am-cart-layout-product-list_item {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
}
.am-cart-layout-product-list_item.am-hidden {
  display: none !important;
}
.am-cart .am-cart-product,
.am-cart-product {
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 14px !important;
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  overflow: hidden !important;
}
.am-cart .am-cart-product:hover,
.am-cart-product:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(var(--am-primary-rgb, 79,70,229), 0.45) !important;
  box-shadow: 0 14px 28px -6px rgba(0,0,0,0.1), 0 0 0 1px rgba(var(--am-primary-rgb, 79,70,229), 0.15) !important;
}

/* Card Content Structure */
.am-cart .am-cart-product .am-cart-product-content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  height: 100% !important;
}
.am-cart .am-cart-product .am-cart-product-content-product {
  padding: 0 !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Product Top Visual Image Card */
.am-cart .am-cart-product .am-cart-product-content-desc-img-wrapper,
.am-cart-product-content-desc-img-wrapper {
  float: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 110px !important;
  background: #ffffff !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 10px !important;
  margin: 0 0 12px 0 !important;
  padding: 10px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.am-cart .am-cart-product .am-cart-product-content-desc-img,
.am-cart-product-content-desc-img,
.am-cart .am-cart-product .am-cart-product-content-desc-img-wrapper img,
.am-cart-product-content-desc-img-wrapper img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.04)) !important;
  transition: transform 0.25s ease !important;
}
.am-cart .am-cart-product:hover .am-cart-product-content-desc-img,
.am-cart-product:hover .am-cart-product-content-desc-img {
  transform: scale(1.06) !important;
}

/* Product Header Row: Title on Left, Description on Right */
.am-cart-product-header-row {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
  width: 100% !important;
}
.am-cart .am-cart-product .am-cart-product-content-title {
  margin-bottom: 0 !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
.am-cart .am-cart-product .am-cart-product-content-title a,
.am-cart .am-cart-product .am-cart-product-content-title h2 {
  float: none !important;
  display: block !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--am-text) !important;
  text-decoration: none !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.am-cart .am-cart-product .am-cart-product-content-title a:hover {
  color: var(--am-primary) !important;
}
.am-cart .am-cart-product .am-cart-new {
  background: var(--am-primary) !important;
  color: #fff !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  margin-left: 6px !important;
  vertical-align: middle !important;
}

/* Product Description on Right Side of Title */
.am-cart .am-cart-product .am-cart-product-content-desc {
  float: none !important;
  font-size: 11.5px !important;
  color: var(--am-text-muted) !important;
  line-height: 1.3 !important;
  margin-bottom: 0 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  text-align: right !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  opacity: 0.85 !important;
}

/* Search input focus styling */
#am-cart-tools-search-input:focus {
  border-color: var(--am-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(var(--am-primary-rgb, 79,70,229), 0.15) !important;
}

/* Add to Cart Container (Bottom) */
.am-cart .am-cart-product .am-cart-product-content-add-container {
  background: transparent !important;
  padding: 12px 0 0 0 !important;
  margin-top: auto !important;
  border-top: 1px solid var(--am-border) !important;
}

/* Pricing / Terms Badge */
.am-cart .am-cart-product .am-cart-product-content-terms,
.am-cart-product-content-terms {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--am-primary) !important;
  margin-bottom: 10px !important;
  padding: 6px 8px !important;
  background: rgba(var(--am-primary-rgb, 79,70,229), 0.08) !important;
  border-radius: 6px !important;
  display: block !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.am-cart-product-content-terms select.billing-plan-select {
  width: 100% !important;
  background: var(--am-surface) !important;
  color: var(--am-text) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

/* Buttons */
.am-cart .am-cart-product .am-cart-product-content-buttons,
.am-cart-product-content-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-top: 0 !important;
}
.am-cart-button-add,
.am-cart-button-order {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 34px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: center !important;
}
.am-cart-button-add {
  background: var(--am-surface) !important;
  color: var(--am-text) !important;
  border: 1px solid var(--am-border) !important;
}
.am-cart-button-add:hover {
  background: var(--am-surface-subtle) !important;
  border-color: var(--am-primary) !important;
  color: var(--am-primary) !important;
}
.am-cart-button-order {
  background: var(--am-primary) !important;
  color: #fff !important;
  border: 1px solid transparent !important;
  box-shadow: 0 2px 6px rgba(var(--am-primary-rgb, 79,70,229), 0.25) !important;
}
.am-cart-button-order:hover {
  background: var(--am-primary-hover) !important;
  transform: translateY(-1px) !important;
}

/* Sidebar Widgets */
.am-cart-sidebar .dash-card {
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 14px !important;
  padding: 20px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
.am-cart-sidebar .dash-card h3 {
  color: var(--am-text) !important;
  font-weight: 700 !important;
}
#cart-search form {
  display: flex !important;
  gap: 8px !important;
}
#cart-search input[type="text"] {
  flex: 1 !important;
  height: 38px !important;
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 8px !important;
  padding: 0 12px !important;
  color: var(--am-text) !important;
  font-size: 13px !important;
  box-sizing: border-box !important;
}
#cart-search input[type="text"]:focus {
  border-color: var(--am-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(var(--am-primary-rgb, 79,70,229), 0.2) !important;
}
#cart-search input[type="submit"] {
  height: 38px !important;
  background: var(--am-primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0 16px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
#cart-search input[type="submit"]:hover {
  background: var(--am-primary-hover) !important;
}

/* Sidebar Login Form */
.am-cart-login-element label {
  display: block !important;
  width: 100% !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--am-text-muted) !important;
  margin-bottom: 4px !important;
}
.am-cart-login-element input[type="text"],
.am-cart-login-element input[type="password"] {
  width: 100% !important;
  height: 38px !important;
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 8px !important;
  padding: 0 12px !important;
  color: var(--am-text) !important;
  font-size: 13px !important;
  box-sizing: border-box !important;
}
.am-cart-login-button {
  margin-top: 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-size: 13px !important;
  color: var(--am-text-muted) !important;
}
.am-cart-login-button input[type="submit"] {
  height: 36px !important;
  background: var(--am-primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0 18px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer !important;
}
.am-cart-login-button a {
  color: var(--am-primary) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

/* Sidebar Basket Preview */
.am-basket-preview {
  font-size: 13px !important;
  color: var(--am-text-muted) !important;
}
.am-basket-preview-empty {
  padding: 12px 14px !important;
  background: var(--am-surface-subtle) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 10px !important;
  line-height: 1.5 !important;
}
.am-basket-preview-empty a {
  color: var(--am-primary) !important;
  font-weight: 600 !important;
}

/* 2-Column Checkout & Basket Layout */
.checkout-wrapper {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .checkout-wrapper {
    grid-template-columns: 1fr;
  }
  .am-cart {
    flex-direction: column !important;
  }
  .am-cart-sidebar {
    width: 100% !important;
  }
}
.checkout-card {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.checkout-summary {
  position: sticky;
  top: 90px;
}

/* ==========================================================================
   CREDITS BALANCE & BILLING TOP-UP STYLES
   ========================================================================== */
.am-credits-card {
  transition: transform var(--am-transition), box-shadow var(--am-transition), border-color var(--am-transition);
}
.am-credits-card:hover {
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.1), 0 8px 10px -6px rgba(16, 185, 129, 0.05);
}
.am-credits-balance-value {
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.am-credit-pkg-card {
  border: 1px solid var(--am-border);
  border-radius: 12px;
  padding: 18px;
  background: var(--am-surface-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all var(--am-transition);
}
.am-credit-pkg-card:hover {
  border-color: var(--am-primary);
  background: var(--am-surface);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(var(--am-primary-rgb, 79, 70, 229), 0.15);
}

/* ==========================================================================
   ACTIVE CLOUD TOOLS CARD GRID (DASHBOARD)
   ========================================================================== */
.am-active-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.am-active-tool-card {
  background: #ffffff;
  border: 1px solid var(--am-border, #e2e8f0);
  border-radius: 12px;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  min-height: 175px;
  transition: transform var(--am-transition), box-shadow var(--am-transition), border-color var(--am-transition);
}
.am-active-tool-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.btn-tool-access {
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 26px;
  border-radius: 8px;
  border: none !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
  transition: background var(--am-transition), transform var(--am-transition);
}
.btn-tool-access:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}
.tool-price-text {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 8px;
  letter-spacing: -0.01em;
}
[data-theme="dark"] .am-active-tool-card {
  background: var(--am-surface);
  border-color: var(--am-border);
}
[data-theme="dark"] .am-active-tool-card .tool-price-text {
  color: var(--am-text);
}







/* ====================================================================
   UNIFIED PAGE MARGINS, HELPDESK & AFFILIATE REPORTS STYLES
   ==================================================================== */

.am-member-shell {
  width: 100%;
}
.am-member-content {
  width: 100% !important;
  max-width: 85% !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

@media (max-width: 1024px) {
  .am-member-content {
    max-width: 100% !important;
    margin: 0 !important;
    width: 100% !important;
  }
}

/* Helpdesk Theme Styles */
.am-helpdesk-page .am-grid-container,
.am-helpdesk-main-card .am-grid-container {
  border: 1px solid var(--am-border) !important;
  border-radius: 12px !important;
  background: var(--am-surface) !important;
  padding: 0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  overflow: hidden !important;
}

.am-helpdesk-page .am-grid,
.am-helpdesk-main-card .am-grid {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0 !important;
}

.am-helpdesk-page .am-grid thead th,
.am-helpdesk-main-card .am-grid thead th {
  background: var(--am-surface-subtle) !important;
  color: var(--am-text-muted) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 12px 16px !important;
  border-bottom: 2px solid var(--am-border) !important;
  border-top: none !important;
  text-align: left !important;
}

.am-helpdesk-main-card .am-grid thead th a,
.am-helpdesk-main-card .am-grid thead th a.a-sort,
.am-helpdesk-main-card .am-grid thead th span {
  color: var(--am-text-muted) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.am-helpdesk-main-card .am-grid thead th a:hover {
  color: var(--am-primary) !important;
}

.am-helpdesk-page .am-grid td,
.am-helpdesk-main-card .am-grid td {
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--am-border) !important;
  font-size: 13.5px !important;
  vertical-align: middle !important;
  color: var(--am-text) !important;
  background: transparent !important;
}

.am-helpdesk-page .am-grid tr:last-child td,
.am-helpdesk-main-card .am-grid tr:last-child td {
  border-bottom: none !important;
}

.am-helpdesk-page .am-grid tr.am-grid-row.even,
.am-helpdesk-page .am-grid tr.am-grid-row.odd,
.am-helpdesk-main-card .am-grid tr.am-grid-row.even,
.am-helpdesk-main-card .am-grid tr.am-grid-row.odd {
  background: transparent !important;
}

.am-helpdesk-page .am-grid tr.am-grid-row:hover td,
.am-helpdesk-main-card .am-grid tr.am-grid-row:hover td {
  background: var(--am-surface-subtle) !important;
}

.am-helpdesk-main-card .am-grid-row.emphasis td {
  font-weight: 600 !important;
}

/* Subject Link in Grid */
.am-helpdesk-main-card .am-grid td.am-helpdesk-grid-subject a.link {
  color: var(--am-text) !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

.am-helpdesk-main-card .am-grid td.am-helpdesk-grid-subject a.link:hover {
  color: var(--am-primary) !important;
}

/* Message count badge in Grid */
.am-helpdesk-main-card .am-helpdesk-grid-msg-cnt {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 6px !important;
  border-radius: 9999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.12) !important;
  color: var(--am-primary) !important;
  border: 1px solid rgba(var(--am-primary-rgb, 79, 70, 229), 0.25) !important;
  margin-left: 6px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

/* Last message preview in Grid */
.am-helpdesk-main-card .am-helpdesk-grid-msg {
  color: var(--am-text-muted) !important;
  font-size: 12.5px !important;
  margin-left: 6px !important;
  font-weight: normal !important;
  display: inline !important;
}

/* Ticket Mask column in Grid */
.am-helpdesk-main-card .am-grid td:nth-child(3) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 13px !important;
  color: var(--am-text-muted) !important;
}

/* Time column in Grid */
.am-helpdesk-main-card .am-grid td time {
  color: var(--am-text-muted) !important;
  font-size: 12.5px !important;
}

/* Status Badge in Helpdesk Grid */
.am-helpdesk-main-card .am-grid td.am-grid-cell-status,
.am-helpdesk-page .am-grid td.am-grid-cell-status {
  text-align: center !important;
  white-space: nowrap !important;
  width: 1% !important;
}

.am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge,
.am-helpdesk-page .am-grid td.am-grid-cell-status .am-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 11px !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em !important;
  transition: all 0.15s ease !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge.am-status-new,
:root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge.am-status-new {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge.am-status-awaiting_user_response,
:root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge.am-status-awaiting_user_response {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge.am-status-awaiting_admin_response,
:root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge.am-status-awaiting_admin_response {
  background: rgba(139, 92, 246, 0.2) !important;
  color: #c084fc !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge.am-status-closed,
:root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td.am-grid-cell-status .am-status-badge.am-status-closed {
  background: #172033 !important;
  color: #94a3b8 !important;
  border-color: #1e293b !important;
}

/* Helpdesk Tickets Grid Title & Count Badge */
.am-helpdesk-main-card .am-grid-wrap h1.am-grid-title,
.am-helpdesk-main-card h1.am-grid-title {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--am-text) !important;
  margin: 0 0 16px 0 !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--am-border) !important;
  line-height: 1.3 !important;
}

.am-helpdesk-main-card .am-grid-title-desc,
.am-grid-title-desc {
  display: inline-flex !important;
  align-items: center !important;
}

.am-helpdesk-main-card .am-grid-title-desc__total,
.am-grid-title-desc__total {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: var(--am-text-muted) !important;
  background: var(--am-surface-subtle) !important;
  border: 1px solid var(--am-border) !important;
  padding: 3px 10px !important;
  border-radius: 9999px !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  display: inline-block !important;
}

/* ====================================================================
   MODERN HELPDESK & TICKET CONVERSATION STYLES
   ==================================================================== */

.am-helpdesk-main-card {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Helpdesk Layout & Support Channels Sidebar */
.am-helpdesk-layout-wrap {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px !important;
  gap: 24px !important;
  align-items: start !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 992px) {
  .am-helpdesk-layout-wrap {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

.am-helpdesk-sidebar-card {
  box-sizing: border-box !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.15s ease !important;
}

.am-helpdesk-sidebar-card .am-support-channel h3 {
  color: var(--am-text) !important;
}

.am-helpdesk-sidebar-card .am-support-channel p {
  color: var(--am-text-muted) !important;
}

.am-helpdesk-sidebar-card .btn:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="dark"] .am-helpdesk-sidebar-card,
:root:not([data-theme="light"]) .am-helpdesk-sidebar-card {
  background: var(--am-surface) !important;
  border-color: var(--am-border) !important;
}

.am-helpdesk-main-card [style*="content-max-width"],
.am-helpdesk-main-card div[style*="content-max-width"],
.am-helpdesk-page [style*="content-max-width"],
.am-helpdesk,
.am-helpdesk-ticket {
  max-width: 100% !important;
  width: 100% !important;
}

.am-helpdesk-main-card .am-filter-wrap {
  margin-bottom: 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.am-helpdesk-main-card .am-filter-wrap input[type="text"] {
  padding: 9px 16px !important;
  border-radius: 10px !important;
  border: 1px solid var(--am-border) !important;
  background: var(--am-surface) !important;
  color: var(--am-text) !important;
  font-size: 13.5px !important;
  transition: all 0.15s ease !important;
}

.am-helpdesk-main-card .am-filter-wrap input[type="text"]:focus {
  border-color: var(--am-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(var(--am-primary-rgb, 79, 70, 229), 0.15) !important;
}

/* Ticket Detail Subject & Top Meta Header */
.am-helpdesk-main-card h1:first-child:not(.am-grid-title),
.am-helpdesk-main-card > div > h1:first-child:not(.am-grid-title) {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: var(--am-text) !important;
  margin: 0 0 18px 0 !important;
  padding-bottom: 18px !important;
  border-bottom: 1px solid var(--am-border) !important;
  line-height: 1.4 !important;
}

.am-helpdesk-main-card h1:first-child .am-grid-back-wrapper {
  display: inline-flex !important;
  align-items: center !important;
  margin-right: 4px !important;
}

.am-helpdesk-main-card h1:first-child .am-grid-back {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: var(--am-surface-subtle) !important;
  border: 1px solid var(--am-border) !important;
  text-decoration: none !important;
  color: var(--am-text) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  background-image: none !important;
  position: relative !important;
}

.am-helpdesk-main-card h1:first-child .am-grid-back::before {
  content: "←" !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: var(--am-text) !important;
}

.am-helpdesk-main-card h1:first-child .am-grid-back:hover {
  background: var(--am-primary) !important;
  border-color: var(--am-primary) !important;
  transform: translateX(-2px) !important;
}

.am-helpdesk-main-card h1:first-child .am-grid-back:hover::before {
  color: #ffffff !important;
}

.am-helpdesk-ticket-subject {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: var(--am-text) !important;
  letter-spacing: -0.01em !important;
}

.am-helpdesk-ticket-mask {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.12) !important;
  color: var(--am-primary) !important;
  border: 1px solid rgba(var(--am-primary-rgb, 79, 70, 229), 0.25) !important;
  letter-spacing: 0.03em !important;
}

.am-helpdesk-ticket-category {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: var(--am-surface-subtle) !important;
  color: var(--am-text-muted) !important;
  border: 1px solid var(--am-border) !important;
}

.am-helpdesk-ticket-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-bottom: 20px !important;
  padding: 0 !important;
}

.am-helpdesk-ticket-info {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  font-size: 13.5px !important;
  color: var(--am-text-muted) !important;
  padding: 0 !important;
}

.am-helpdesk-ticket-info strong {
  color: var(--am-text) !important;
  font-weight: 600 !important;
}

/* Action Buttons Container & Links */
.am-helpdesk-ticket-actions-container {
  border: none !important;
  background: transparent !important;
  margin: 0 0 24px 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.am-helpdesk-ticket-actions,
ul.am-helpdesk-ticket-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
  overflow: visible !important;
}

.am-helpdesk-ticket-action {
  display: inline-flex !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.am-helpdesk-ticket-action a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 9px 20px !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
}

/* First action is Reply -> Primary Accent Button */
.am-helpdesk-ticket-action:first-child a,
.am-helpdesk-ticket-action.am-helpdesk-action-reply a {
  background: var(--am-primary) !important;
  color: #ffffff !important;
  border: 1px solid var(--am-primary) !important;
  box-shadow: 0 2px 8px rgba(var(--am-primary-rgb, 79, 70, 229), 0.3) !important;
}

.am-helpdesk-ticket-action:first-child a:hover,
.am-helpdesk-ticket-action.am-helpdesk-action-reply a:hover {
  background: var(--am-primary-hover) !important;
  border-color: var(--am-primary-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(var(--am-primary-rgb, 79, 70, 229), 0.4) !important;
}

/* Secondary actions (Refresh, etc.) */
.am-helpdesk-ticket-action:not(:first-child):not(.am-helpdesk-ticket-action-fold-all) a {
  background: var(--am-surface) !important;
  color: var(--am-text) !important;
  border: 1px solid var(--am-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.am-helpdesk-ticket-action:not(:first-child):not(.am-helpdesk-ticket-action-fold-all) a:hover {
  background: var(--am-surface-subtle) !important;
  border-color: var(--am-text-muted) !important;
  transform: translateY(-1px) !important;
}

/* Fold all button */
.am-helpdesk-ticket-action.am-helpdesk-ticket-action-fold-all {
  margin-left: auto !important;
  float: none !important;
}

.am-helpdesk-ticket-action.am-helpdesk-ticket-action-fold-all a {
  padding: 0 !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
  color: var(--am-text-muted) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

.am-helpdesk-ticket-action.am-helpdesk-ticket-action-fold-all a:hover {
  background: var(--am-surface-subtle) !important;
  color: var(--am-text) !important;
}

/* Conversation Date Separator */
.am-helpdesk-date {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 32px 0 24px !important;
  color: var(--am-text-muted) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

/* Chat Stream Layout */
.am-helpdesk {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Date Divider */
.am-helpdesk-date {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 18px 0 !important;
  color: var(--am-text-muted) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

.am-helpdesk-date::before,
.am-helpdesk-date::after {
  content: "" !important;
  flex: 1 !important;
  height: 1px !important;
  background: var(--am-border) !important;
}

.am-helpdesk-date::before {
  margin-right: 18px !important;
}
.am-helpdesk-date::after {
  margin-left: 18px !important;
}

/* Chat Message Bubbles */
.am-helpdesk-message {
  max-width: 78% !important;
  min-width: 240px !important;
  width: auto !important;
  border: 1px solid var(--am-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .am-helpdesk-message {
    max-width: 95% !important;
  }
}

.am-helpdesk-message-header {
  padding: 10px 16px 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  font-size: 13px !important;
  opacity: 1 !important;
  line-height: 1.4 !important;
}

.am-helpdesk-message-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.am-chat-author-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.am-helpdesk-message-author {
  font-weight: 700 !important;
  color: var(--am-text) !important;
  font-size: 13.5px !important;
}

.am-helpdesk-message-date {
  color: var(--am-text-muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
}

/* Hide legacy fold button */
.am-helpdesk-message-action-fold,
.am-helpdesk-ticket .am-helpdesk-ticket-action-fold-all {
  display: none !important;
}

/* Chat Avatars */
.am-chat-avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.am-chat-avatar-support {
  background: linear-gradient(135deg, var(--am-primary), var(--am-primary-hover)) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px -1px rgba(var(--am-primary-rgb, 79, 70, 229), 0.35) !important;
}

.am-chat-avatar-user {
  background: var(--am-surface-subtle) !important;
  color: var(--am-primary) !important;
  border: 1px solid var(--am-border) !important;
}

/* Support Staff Badge */
.am-chat-support-badge {
  display: inline-block !important;
  padding: 1px 7px !important;
  border-radius: 9999px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.12) !important;
  color: var(--am-primary) !important;
  border: 1px solid rgba(var(--am-primary-rgb, 79, 70, 229), 0.25) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  line-height: 1.4 !important;
}

/* Inbound Message (Administrator / Support Staff - LEFT BUBBLE) */
.am-helpdesk-message.am-helpdesk-message-inbound {
  align-self: flex-start !important;
  margin-right: auto !important;
  margin-left: 0 !important;
  border-radius: 18px 18px 18px 4px !important;
  background: var(--am-surface-subtle) !important;
  border-color: var(--am-border) !important;
  border-left: 3px solid var(--am-primary) !important;
}

.am-helpdesk-message.am-helpdesk-message-inbound .am-helpdesk-message-header {
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.03) !important;
  border-bottom: 1px solid var(--am-border) !important;
}

/* Outbound Message (Customer / User - RIGHT BUBBLE) */
.am-helpdesk-message.am-helpdesk-message-outbound {
  align-self: flex-end !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  border-radius: 18px 18px 4px 18px !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.08) !important;
  border-color: rgba(var(--am-primary-rgb, 79, 70, 229), 0.22) !important;
}

.am-helpdesk-message.am-helpdesk-message-outbound .am-helpdesk-message-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(var(--am-primary-rgb, 79, 70, 229), 0.12) !important;
}

.am-helpdesk-message.am-helpdesk-message-outbound .am-helpdesk-message-author {
  color: var(--am-primary) !important;
}

/* Message Content Typography */
.am-helpdesk-message-content {
  padding: 12px 18px 14px !important;
  color: var(--am-text) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

.am-helpdesk-message-content pre {
  font-family: inherit !important;
  font-size: 14px !important;
  color: var(--am-text) !important;
  background: transparent !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* Chat Quoted Message Preview (WhatsApp / Slack style reply quote) */
.am-chat-quote {
  margin: 8px 0 4px 0 !important;
  padding: 8px 12px !important;
  border-left: 3px solid var(--am-primary) !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.08) !important;
  border-radius: 4px 8px 8px 4px !important;
  font-size: 13px !important;
  display: block !important;
  white-space: normal !important;
}

.am-chat-quote-badge {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  color: var(--am-primary) !important;
  margin-bottom: 2px !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.am-chat-quote-body {
  color: var(--am-text-muted) !important;
  font-style: italic !important;
  line-height: 1.45 !important;
}

/* Reply Action inside message card */
.am-helpdesk-message-actions {
  padding: 4px 16px 10px !important;
  display: flex !important;
  justify-content: flex-end !important;
  border-top: none !important;
  background: transparent !important;
}

.am-helpdesk-message-action-reply a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: var(--am-primary) !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.08) !important;
  border: 1px solid rgba(var(--am-primary-rgb, 79, 70, 229), 0.18) !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}

.am-helpdesk-message-action-reply a:hover {
  background: var(--am-primary) !important;
  color: #ffffff !important;
}

/* Message Attachments */
.am-helpdesk-message-attachments {
  margin: 14px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.am-helpdesk-message-attachments-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  background: var(--am-surface-subtle) !important;
  border: 1px solid var(--am-border) !important;
  font-size: 12.5px !important;
  color: var(--am-text) !important;
}

.am-helpdesk-message-attachments-item a {
  color: var(--am-primary) !important;
  text-decoration: none !important;
  font-weight: 600 !important;
}

/* Reply Panel Container & Form */
.am-helpdesk-reply-panel {
  padding: 20px !important;
  border-radius: 12px !important;
  background: var(--am-surface-subtle) !important;
  border: 1px solid var(--am-border) !important;
  margin-top: 16px !important;
}

.am-helpdesk-reply-panel-tools {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--am-border) !important;
  margin-bottom: 14px !important;
}

.am-helpdesk-reply-panel-tool a {
  padding: 4px 10px !important;
  border-radius: 6px !important;
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
  color: var(--am-text) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}

.am-helpdesk-reply-panel-tool a:hover {
  background: var(--am-primary) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.am-helpdesk-reply-panel-content textarea,
.am-helpdesk-reply-panel-content .am-form textarea,
#am-helpdesk-msg-area {
  width: 100% !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  background: var(--am-surface) !important;
  color: var(--am-text) !important;
  box-sizing: border-box !important;
  line-height: 1.5 !important;
  min-height: 120px !important;
  transition: border-color 0.15s ease !important;
}

.am-helpdesk-reply-panel-content textarea:focus,
#am-helpdesk-msg-area:focus {
  border-color: var(--am-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(var(--am-primary-rgb, 79, 70, 229), 0.15) !important;
}

.am-helpdesk-reply-panel-content input[type="submit"] {
  background: var(--am-primary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 9px 22px !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  margin-top: 12px !important;
  box-shadow: 0 2px 6px rgba(var(--am-primary-rgb, 79, 70, 229), 0.25) !important;
}

.am-helpdesk-reply-panel-content input[type="submit"]:hover {
  background: var(--am-primary-hover) !important;
  transform: translateY(-1px) !important;
}

/* Submit New Ticket Form inside Helpdesk Main Card */
.am-helpdesk-main-card .am-form {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.am-helpdesk-main-card .am-form form {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.am-helpdesk-main-card .am-form .am-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

.am-helpdesk-main-card .am-form .am-element-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: var(--am-text) !important;
  padding: 0 !important;
}

.am-helpdesk-main-card .am-form .am-element {
  padding: 0 !important;
  width: 100% !important;
}

.am-helpdesk-main-card .am-form input[type="text"],
.am-helpdesk-main-card .am-form select,
.am-helpdesk-main-card .am-form textarea {
  width: 100% !important;
  max-width: 100% !important;
  padding: 11px 16px !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 10px !important;
  background: var(--am-surface) !important;
  color: var(--am-text) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

.am-helpdesk-main-card .am-form input[type="text"]:focus,
.am-helpdesk-main-card .am-form select:focus,
.am-helpdesk-main-card .am-form textarea:focus {
  border-color: var(--am-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(var(--am-primary-rgb, 79, 70, 229), 0.15) !important;
}

/* ====================================================================
   Category of Question (Horizontal Button Pills in 1 Line)
   ==================================================================== */
[id^="row-category_id"] .am-element,
.am-row:has([name="category_id"]) .am-element,
.am-helpdesk-form [id^="row-category_id"] .am-element {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 4px !important;
}

[id^="row-category_id"] .am-element br,
.am-row:has([name="category_id"]) .am-element br,
.am-helpdesk-form [id^="row-category_id"] .am-element br {
  display: none !important;
}

[id^="row-category_id"] .am-element label,
.am-row:has([name="category_id"]) .am-element label,
.am-helpdesk-form [id^="row-category_id"] .am-element label {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 20px !important;
  border-radius: 10px !important;
  border: 1.5px solid var(--am-border) !important;
  background: var(--am-surface) !important;
  color: var(--am-text) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

[id^="row-category_id"] .am-element label:hover,
.am-row:has([name="category_id"]) .am-element label:hover,
.am-helpdesk-form [id^="row-category_id"] .am-element label:hover {
  border-color: var(--am-primary) !important;
  background: var(--am-surface-subtle) !important;
  color: var(--am-primary) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Radio button dot styling */
[id^="row-category_id"] .am-element input[type="radio"],
.am-row:has([name="category_id"]) .am-element input[type="radio"],
.am-helpdesk-form [id^="row-category_id"] .am-element input[type="radio"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 15px !important;
  height: 15px !important;
  border: 1.5px solid var(--am-border) !important;
  border-radius: 50% !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  outline: none !important;
  cursor: pointer !important;
  display: inline-block !important;
  position: relative !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
}

[id^="row-category_id"] .am-element input[type="radio"]::after,
.am-row:has([name="category_id"]) .am-element input[type="radio"]::after,
.am-helpdesk-form [id^="row-category_id"] .am-element input[type="radio"]::after {
  content: "" !important;
  position: absolute !important;
  inset: 2px !important;
  border-radius: 50% !important;
  background: transparent !important;
  transition: all 0.15s ease !important;
}

/* Active / Checked Button Pill */
[id^="row-category_id"] .am-element label:has(input[type="radio"]:checked),
.am-row:has([name="category_id"]) .am-element label:has(input[type="radio"]:checked),
.am-helpdesk-form [id^="row-category_id"] .am-element label:has(input[type="radio"]:checked),
[id^="row-category_id"] .am-element label.is-active,
.am-row:has([name="category_id"]) .am-element label.is-active,
.am-helpdesk-form [id^="row-category_id"] .am-element label.is-active {
  background: var(--am-primary) !important;
  border-color: var(--am-primary) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(var(--am-primary-rgb, 79, 70, 229), 0.35) !important;
  transform: translateY(-1px) !important;
}

[id^="row-category_id"] .am-element label:has(input[type="radio"]:checked) input[type="radio"],
.am-row:has([name="category_id"]) .am-element label:has(input[type="radio"]:checked) input[type="radio"],
.am-helpdesk-form [id^="row-category_id"] .am-element label:has(input[type="radio"]:checked) input[type="radio"],
[id^="row-category_id"] .am-element label.is-active input[type="radio"],
.am-row:has([name="category_id"]) .am-element label.is-active input[type="radio"],
.am-helpdesk-form [id^="row-category_id"] .am-element label.is-active input[type="radio"] {
  border-color: #ffffff !important;
  background: rgba(255, 255, 255, 0.25) !important;
}

[id^="row-category_id"] .am-element label:has(input[type="radio"]:checked) input[type="radio"]::after,
.am-row:has([name="category_id"]) .am-element label:has(input[type="radio"]:checked) input[type="radio"]::after,
.am-helpdesk-form [id^="row-category_id"] .am-element label:has(input[type="radio"]:checked) input[type="radio"]::after,
[id^="row-category_id"] .am-element label.is-active input[type="radio"]::after,
.am-row:has([name="category_id"]) .am-element label.is-active input[type="radio"]::after,
.am-helpdesk-form [id^="row-category_id"] .am-element label.is-active input[type="radio"]::after {
  background: #ffffff !important;
}

/* Dark mode overrides for Category Button Pills */
[data-theme="dark"] [id^="row-category_id"] .am-element label,
:root:not([data-theme="light"]) [id^="row-category_id"] .am-element label {
  background: #111827 !important;
  border-color: #1f293d !important;
  color: #f1f5f9 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] [id^="row-category_id"] .am-element label:hover,
:root:not([data-theme="light"]) [id^="row-category_id"] .am-element label:hover {
  background: #1e293b !important;
  border-color: var(--am-primary) !important;
  color: #ffffff !important;
}

[data-theme="dark"] [id^="row-category_id"] .am-element label:has(input[type="radio"]:checked),
[data-theme="dark"] [id^="row-category_id"] .am-element label.is-active,
:root:not([data-theme="light"]) [id^="row-category_id"] .am-element label:has(input[type="radio"]:checked),
:root:not([data-theme="light"]) [id^="row-category_id"] .am-element label.is-active {
  background: var(--am-primary) !important;
  border-color: var(--am-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(var(--am-primary-rgb, 79, 70, 229), 0.45) !important;
}

.am-helpdesk-main-card .am-form input[type="submit"] {
  background: var(--am-primary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 12px 28px !important;
  font-weight: 700 !important;
  font-size: 14.5px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 4px 14px -2px rgba(var(--am-primary-rgb, 79, 70, 229), 0.35) !important;
  align-self: flex-start !important;
}

.am-helpdesk-main-card .am-form input[type="submit"]:hover {
  background: var(--am-primary-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px -2px rgba(var(--am-primary-rgb, 79, 70, 229), 0.45) !important;
}

/* ====================================================================
   DARK MODE OVERRIDES FOR HELPDESK & TICKETS
   ==================================================================== */
[data-theme="dark"] .am-helpdesk-main-card h1:first-child .am-grid-back {
  background: #172033 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-main-card h1:first-child .am-grid-back::before {
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-message {
  border-color: #1e293b !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .am-helpdesk-message.am-helpdesk-message-inbound {
  background: #172033 !important;
  border-color: #1e293b !important;
  border-left: 3px solid #6366f1 !important;
}

[data-theme="dark"] .am-helpdesk-message.am-helpdesk-message-inbound .am-helpdesk-message-header {
  background: rgba(99, 102, 241, 0.08) !important;
  border-bottom-color: #1e293b !important;
}

[data-theme="dark"] .am-helpdesk-message.am-helpdesk-message-outbound {
  background: #1e1b4b !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
}

[data-theme="dark"] .am-helpdesk-message.am-helpdesk-message-outbound .am-helpdesk-message-header {
  background: transparent !important;
  border-bottom-color: rgba(99, 102, 241, 0.2) !important;
}

[data-theme="dark"] .am-helpdesk-message.am-helpdesk-message-outbound .am-helpdesk-message-author {
  color: #a5b4fc !important;
}

[data-theme="dark"] .am-chat-avatar-user {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #a5b4fc !important;
}

[data-theme="dark"] .am-chat-quote {
  background: rgba(99, 102, 241, 0.15) !important;
  border-left-color: #818cf8 !important;
}

[data-theme="dark"] .am-chat-quote-badge {
  color: #a5b4fc !important;
}

[data-theme="dark"] .am-chat-quote-body {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .am-helpdesk-message-content,
[data-theme="dark"] .am-helpdesk-message-content pre {
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-message-author {
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-message-date {
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-helpdesk-date {
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-helpdesk-ticket-action:not(:first-child):not(.am-helpdesk-ticket-action-fold-all) a {
  background: #111726 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-ticket-action:not(:first-child):not(.am-helpdesk-ticket-action-fold-all) a:hover {
  background: #172033 !important;
  border-color: #6366f1 !important;
}

[data-theme="dark"] .am-helpdesk-ticket-action-fold-all a {
  background: #111726 !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-helpdesk-reply-panel {
  background: #172033 !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .am-helpdesk-reply-panel-content textarea,
[data-theme="dark"] #am-helpdesk-msg-area {
  background: #090d16 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-reply-panel-tool a {
  background: #111726 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-form input[type="text"],
[data-theme="dark"] .am-helpdesk-main-card .am-form select,
[data-theme="dark"] .am-helpdesk-main-card .am-form textarea {
  background: #090d16 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

/* Helpdesk Grid Dark Mode */
[data-theme="dark"] .am-helpdesk-main-card .am-grid-container {
  border-color: #1e293b !important;
  background: #111726 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid thead th {
  background: #172033 !important;
  color: #94a3b8 !important;
  border-bottom: 2px solid #1e293b !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid thead th a,
[data-theme="dark"] .am-helpdesk-main-card .am-grid thead th a.a-sort,
[data-theme="dark"] .am-helpdesk-main-card .am-grid thead th span {
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid thead th a:hover {
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td {
  border-bottom-color: #1e293b !important;
  color: #cbd5e1 !important;
  background: transparent !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid tr.am-grid-row.even,
[data-theme="dark"] .am-helpdesk-main-card .am-grid tr.am-grid-row.odd {
  background: transparent !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid tr.am-grid-row:hover td {
  background: #172033 !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid tr.am-grid-row.emphasis td {
  background: rgba(99, 102, 241, 0.08) !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td.am-helpdesk-grid-subject a.link {
  color: #f8fafc !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td.am-helpdesk-grid-subject a.link:hover {
  color: #818cf8 !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-helpdesk-grid-msg-cnt {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #a5b4fc !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-helpdesk-grid-msg {
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td:nth-child(3) {
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid td time {
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-grid-title-desc__total,
[data-theme="dark"] .am-grid-title-desc__total {
  background: #172033 !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-helpdesk-main-card .am-filter-wrap input[type="text"] {
  background: #090d16 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

/* System Dark Theme Preference for Helpdesk */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .am-helpdesk-main-card h1:first-child .am-grid-back {
    background: #172033 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card h1:first-child .am-grid-back::before {
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message {
    border-color: #1e293b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message.am-helpdesk-message-inbound {
    background: #172033 !important;
    border-color: #1e293b !important;
    border-left: 3px solid #6366f1 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message.am-helpdesk-message-inbound .am-helpdesk-message-header {
    background: rgba(99, 102, 241, 0.08) !important;
    border-bottom-color: #1e293b !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message.am-helpdesk-message-outbound {
    background: #1e1b4b !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message.am-helpdesk-message-outbound .am-helpdesk-message-header {
    background: transparent !important;
    border-bottom-color: rgba(99, 102, 241, 0.2) !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message.am-helpdesk-message-outbound .am-helpdesk-message-author {
    color: #a5b4fc !important;
  }

  :root:not([data-theme="light"]) .am-chat-avatar-user {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #a5b4fc !important;
  }

  :root:not([data-theme="light"]) .am-chat-quote {
    background: rgba(99, 102, 241, 0.15) !important;
    border-left-color: #818cf8 !important;
  }

  :root:not([data-theme="light"]) .am-chat-quote-badge {
    color: #a5b4fc !important;
  }

  :root:not([data-theme="light"]) .am-chat-quote-body {
    color: #cbd5e1 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message-content,
  :root:not([data-theme="light"]) .am-helpdesk-message-content pre {
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message-author {
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-message-date {
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-date {
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-ticket-action:not(:first-child):not(.am-helpdesk-ticket-action-fold-all) a {
    background: #111726 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-ticket-action:not(:first-child):not(.am-helpdesk-ticket-action-fold-all) a:hover {
    background: #172033 !important;
    border-color: #6366f1 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-ticket-action-fold-all a {
    background: #111726 !important;
    border-color: #1e293b !important;
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-reply-panel {
    background: #172033 !important;
    border-color: #1e293b !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-reply-panel-content textarea,
  :root:not([data-theme="light"]) #am-helpdesk-msg-area {
    background: #090d16 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-reply-panel-tool a {
    background: #111726 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-form input[type="text"],
  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-form select,
  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-form textarea {
    background: #090d16 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
  }

  /* Helpdesk Grid System Dark Mode */
  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid-container {
    border-color: #1e293b !important;
    background: #111726 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid thead th {
    background: #172033 !important;
    color: #94a3b8 !important;
    border-bottom: 2px solid #1e293b !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid thead th a,
  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid thead th a.a-sort,
  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid thead th span {
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid thead th a:hover {
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td {
    border-bottom-color: #1e293b !important;
    color: #cbd5e1 !important;
    background: transparent !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid tr.am-grid-row.even,
  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid tr.am-grid-row.odd {
    background: transparent !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid tr.am-grid-row:hover td {
    background: #172033 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid tr.am-grid-row.emphasis td {
    background: rgba(99, 102, 241, 0.08) !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td.am-helpdesk-grid-subject a.link {
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td.am-helpdesk-grid-subject a.link:hover {
    color: #818cf8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-helpdesk-grid-msg-cnt {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-helpdesk-grid-msg {
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td:nth-child(3) {
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid td time {
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-grid-title-desc__total,
  :root:not([data-theme="light"]) .am-grid-title-desc__total {
    background: #172033 !important;
    border-color: #1e293b !important;
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-main-card .am-filter-wrap input[type="text"] {
    background: #090d16 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-helpdesk-attachment-expand {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    color: #818cf8 !important;
  }
}

/* Attachments Styling */
.am-helpdesk-attachment-expand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: var(--am-primary) !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  text-decoration: none !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.08) !important;
  border: 1px dashed rgba(var(--am-primary-rgb, 79, 70, 229), 0.3) !important;
  transition: all 0.15s ease !important;
}

.am-helpdesk-attachment-expand:hover {
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.15) !important;
  color: var(--am-primary-hover) !important;
}

.am-helpdesk-attachment-expand::before {
  content: "📎 ";
  font-size: 14px;
}

[data-theme="dark"] .am-helpdesk-attachment-expand {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  color: #818cf8 !important;
}

/* Grid Norecord Actions */
.am-helpdesk-main-card .am-norecord-actions {
  margin: 16px 0 !important;
}

.am-helpdesk-main-card .am-norecord-actions a.button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
  background: var(--am-primary) !important;
  color: #fff !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: 0 3px 10px -2px rgba(var(--am-primary-rgb, 79, 70, 229), 0.35) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.am-helpdesk-main-card .am-norecord-actions a.button:hover {
  background: var(--am-primary-hover) !important;
  transform: translateY(-1px) !important;
}

/* Submitted Ticket Success Box */
.am-helpdesk-main-card > h1:first-child:not(.am-grid-title) {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: var(--am-text) !important;
  margin: 0 0 16px 0 !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid var(--am-border) !important;
}

.am-helpdesk-main-card > p {
  font-size: 14.5px !important;
  color: var(--am-text) !important;
  line-height: 1.6 !important;
  margin-bottom: 12px !important;
}

.am-helpdesk-main-card > p strong {
  color: var(--am-primary) !important;
  font-weight: 700 !important;
  font-size: 15px !important;
}

.am-helpdesk-main-card > p a.link {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 12px !important;
  border-radius: 8px !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.1) !important;
  border: 1px solid rgba(var(--am-primary-rgb, 79, 70, 229), 0.25) !important;
  color: var(--am-primary) !important;
  text-decoration: none !important;
  margin-left: 6px !important;
  font-weight: 700 !important;
  transition: all 0.15s ease !important;
}

.am-helpdesk-main-card > p a.link:hover {
  background: var(--am-primary) !important;
  color: #fff !important;
}

.am-helpdesk-main-card > p a.link strong {
  color: inherit !important;
}


/* Morris Chart Modern SaaS Graph Styling */
.am-modern-chart-box svg {
  overflow: visible;
  max-width: 100%;
}
.morris-hover {
  position: absolute;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.94) !important;
  backdrop-filter: blur(8px);
  color: #ffffff !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4) !important;
  pointer-events: none;
}
.morris-hover-row-label {
  font-weight: 700 !important;
  color: #94a3b8 !important;
  margin-bottom: 4px !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em;
}
.morris-hover-point {
  font-weight: 600 !important;
  margin: 3px 0 !important;
  color: #ffffff !important;
}
svg text {
  fill: var(--am-text-muted) !important;
  font-family: inherit !important;
  font-size: 11px !important;
}
svg path[stroke="#aaaaaa"], svg path[stroke="#ccc"], svg path[stroke="#eef0f2"], svg path[stroke="#e2e8f0"] {
  stroke: var(--am-border) !important;
  stroke-dasharray: 4,4;
}

/* ====================================================================
   MODERN POPUP & MODAL DIALOG STYLES (.am-popup, .am-common)
   ==================================================================== */

.am-popup-mask,
div.am-popup-mask {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 99999 !important;
  transition: opacity 0.2s ease !important;
}

.am-popup,
div.am-popup,
.am-popup.am-common {
  background: var(--am-surface, #ffffff) !important;
  color: var(--am-text, #1e293b) !important;
  border: 1px solid var(--am-border, #e2e8f0) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
  font-family: inherit !important;
  padding: 0 !important;
  overflow: hidden !important;
  z-index: 100001 !important;
  min-width: 320px !important;
  max-width: 650px !important;
  width: 90% !important;
  box-sizing: border-box !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
}

.am-popup .am-popup-header {
  padding: 16px 20px !important;
  background: var(--am-surface-subtle, #f8fafc) !important;
  border-bottom: 1px solid var(--am-border, #e2e8f0) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  margin: 0 !important;
  overflow: visible !important;
}

/* Ensure title stays on the LEFT */
.am-popup .am-popup-title {
  order: 1 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--am-text, #0f172a) !important;
  margin: 0 !important;
  line-height: 1.4 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
}

/* Ensure close button sits on the RIGHT with sleek rounded styling */
.am-popup .am-popup-close-icon {
  order: 2 !important;
  margin-left: auto !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: var(--am-surface, #ffffff) !important;
  border: 1px solid var(--am-border, #cbd5e1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--am-text-muted, #64748b) !important;
  font-size: 13px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  float: none !important;
  margin-right: 0 !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.am-popup .am-popup-close-icon:after {
  content: "✕" !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: var(--am-text-muted, #64748b) !important;
  transition: color 0.15s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.am-popup .am-popup-close-icon:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  transform: rotate(90deg) scale(1.08) !important;
}

.am-popup .am-popup-close-icon:hover:after {
  color: #ef4444 !important;
}

/* Modal Content: flush 0 padding so table stretches smoothly edge-to-edge */
.am-popup .am-popup-content {
  padding: 0 !important;
  background: var(--am-surface, #ffffff) !important;
  color: var(--am-text, #334155) !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  max-height: 480px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

/* Scrollbar inside popup content */
.am-popup .am-popup-content::-webkit-scrollbar {
  width: 6px;
}
.am-popup .am-popup-content::-webkit-scrollbar-track {
  background: transparent;
}
.am-popup .am-popup-content::-webkit-scrollbar-thumb {
  background: var(--am-border, #cbd5e1);
  border-radius: 9999px;
}

/* Clean grid/table inside popup - eliminate outer gaps & borders */
.am-popup .am-grid-container {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow-x: auto !important;
}

.am-popup table.am-grid {
  width: 100% !important;
  border-collapse: collapse !important;
  background: transparent !important;
  margin: 0 !important;
}

.am-popup table.am-grid thead tr,
.am-popup table.am-grid tr:first-child:not(.am-grid-row) {
  background: var(--am-surface-subtle, #f8fafc) !important;
  border-bottom: 2px solid var(--am-border, #e2e8f0) !important;
}

.am-popup table.am-grid th {
  background: var(--am-surface-subtle, #f8fafc) !important;
  color: var(--am-text-muted, #64748b) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 12px 20px !important;
  border: none !important;
  border-bottom: 2px solid var(--am-border, #e2e8f0) !important;
  text-align: left !important;
}

.am-popup table.am-grid td {
  padding: 13px 20px !important;
  border: none !important;
  border-bottom: 1px solid var(--am-border, #e2e8f0) !important;
  font-size: 13.5px !important;
  color: var(--am-text, #1e293b) !important;
  vertical-align: middle !important;
  background: transparent !important;
}

.am-popup table.am-grid tr.am-grid-row {
  background: transparent !important;
  transition: background 0.15s ease !important;
}

.am-popup table.am-grid tr.am-grid-row:hover,
.am-popup table.am-grid tr.am-grid-row:hover td {
  background: var(--am-surface-hover, #f1f5f9) !important;
}

.am-popup table.am-grid tr.am-grid-row:last-child td {
  border-bottom: none !important;
}

/* ====================================================================
   DARK MODE OVERRIDES FOR POPUPS (Explicit & System Preference)
   ==================================================================== */
[data-theme="dark"] .am-popup,
[data-theme="dark"] div.am-popup,
[data-theme="dark"] .am-popup.am-common {
  background: #111726 !important;
  color: #f8fafc !important;
  border-color: #1e293b !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .am-popup .am-popup-header {
  background: #172033 !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .am-popup .am-popup-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .am-popup .am-popup-close-icon {
  background: #111726 !important;
  border-color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .am-popup .am-popup-close-icon:after {
  color: #94a3b8 !important;
}

[data-theme="dark"] .am-popup .am-popup-close-icon:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
}

[data-theme="dark"] .am-popup .am-popup-close-icon:hover:after {
  color: #fca5a5 !important;
}

[data-theme="dark"] .am-popup .am-popup-content {
  background: #111726 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .am-popup table.am-grid thead tr,
[data-theme="dark"] .am-popup table.am-grid tr:first-child:not(.am-grid-row),
[data-theme="dark"] .am-popup table.am-grid th {
  background: #172033 !important;
  color: #94a3b8 !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .am-popup table.am-grid td {
  background: transparent !important;
  border-color: #1e293b !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .am-popup table.am-grid tr.am-grid-row:hover,
[data-theme="dark"] .am-popup table.am-grid tr.am-grid-row:hover td {
  background: #1c273e !important;
}

[data-theme="dark"] .am-popup .badge {
  background: #172033 !important;
  color: #94a3b8 !important;
  border-color: #1e293b !important;
}

/* System Dark Theme Preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .am-popup,
  :root:not([data-theme="light"]) div.am-popup,
  :root:not([data-theme="light"]) .am-popup.am-common {
    background: #111726 !important;
    color: #f8fafc !important;
    border-color: #1e293b !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  }

  :root:not([data-theme="light"]) .am-popup .am-popup-header {
    background: #172033 !important;
    border-color: #1e293b !important;
  }

  :root:not([data-theme="light"]) .am-popup .am-popup-title {
    color: #f8fafc !important;
  }

  :root:not([data-theme="light"]) .am-popup .am-popup-close-icon {
    background: #111726 !important;
    border-color: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  }

  :root:not([data-theme="light"]) .am-popup .am-popup-close-icon:after {
    color: #94a3b8 !important;
  }

  :root:not([data-theme="light"]) .am-popup .am-popup-close-icon:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
  }

  :root:not([data-theme="light"]) .am-popup .am-popup-close-icon:hover:after {
    color: #fca5a5 !important;
  }

  :root:not([data-theme="light"]) .am-popup .am-popup-content {
    background: #111726 !important;
    color: #cbd5e1 !important;
  }

  :root:not([data-theme="light"]) .am-popup table.am-grid thead tr,
  :root:not([data-theme="light"]) .am-popup table.am-grid tr:first-child:not(.am-grid-row),
  :root:not([data-theme="light"]) .am-popup table.am-grid th {
    background: #172033 !important;
    color: #94a3b8 !important;
    border-color: #1e293b !important;
  }

  :root:not([data-theme="light"]) .am-popup table.am-grid td {
    background: transparent !important;
    border-color: #1e293b !important;
    color: #e2e8f0 !important;
  }

  :root:not([data-theme="light"]) .am-popup table.am-grid tr.am-grid-row:hover,
  :root:not([data-theme="light"]) .am-popup table.am-grid tr.am-grid-row:hover td {
    background: #1c273e !important;
  }

  :root:not([data-theme="light"]) .am-popup .badge {
    background: #172033 !important;
    color: #94a3b8 !important;
    border-color: #1e293b !important;
  }
}


/* ==========================================================================
   Credits & Balance Modern SaaS Dashboard Page
   ========================================================================== */
.am-page-credits .am-member-shell {
  width: 100% !important;
}

.am-credits-page {
  width: 100% !important;
  box-sizing: border-box !important;
}

.am-credits-hero {
  border-radius: 16px !important;
  transition: all 0.2s ease !important;
}

.am-credits-kpi-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.am-credits-kpi-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(var(--am-primary-rgb, 79, 70, 229), 0.3) !important;
}

.am-credits-ledger-card {
  border-radius: 16px !important;
}

.am-credits-grid-wrap .am-grid-wrap {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.am-credits-grid-wrap .am-grid-title,
.am-credits-grid-wrap .am-grid-header {
  display: none !important;
}

.am-credits-grid-wrap .am-grid-container {
  border: 1px solid var(--am-border) !important;
  border-radius: 12px !important;
  background: var(--am-surface) !important;
  padding: 0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  overflow: hidden !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.am-credits-grid-wrap .am-grid {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0 !important;
  background: transparent !important;
}

.am-credits-grid-wrap .am-grid thead th {
  background: var(--am-surface-subtle) !important;
  color: var(--am-text-muted) !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 12px 18px !important;
  border-bottom: 2px solid var(--am-border) !important;
  border-top: none !important;
  text-align: left !important;
}

.am-credits-grid-wrap .am-grid thead th a,
.am-credits-grid-wrap .am-grid thead th a.a-sort,
.am-credits-grid-wrap .am-grid thead th span {
  color: var(--am-text-muted) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.am-credits-grid-wrap .am-grid thead th a:hover {
  color: var(--am-primary) !important;
}

.am-credits-grid-wrap .am-grid td {
  padding: 15px 18px !important;
  border-bottom: 1px solid var(--am-border) !important;
  font-size: 13.5px !important;
  vertical-align: middle !important;
  color: var(--am-text) !important;
  background: transparent !important;
}

.am-credits-grid-wrap .am-grid tr:last-child td {
  border-bottom: none !important;
}

.am-credits-grid-wrap .am-grid tr.am-grid-row.even,
.am-credits-grid-wrap .am-grid tr.am-grid-row.odd {
  background: transparent !important;
}

.am-credits-grid-wrap .am-grid tr.am-grid-row:hover td {
  background: var(--am-surface-subtle) !important;
}

/* Empty state in credits ledger */
.am-credits-grid-wrap .td-nodata {
  padding: 48px 24px !important;
  text-align: center !important;
}

.am-credits-grid-wrap .td-nodata h2 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: var(--am-text) !important;
  margin: 0 0 6px !important;
}

.am-credits-grid-wrap .td-nodata p {
  font-size: 13.5px !important;
  color: var(--am-text-muted) !important;
  margin: 0 !important;
}

/* Paginator in credits */
.am-credits-grid-wrap .am-pagination {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  padding: 18px 0 0 !important;
  margin: 0 !important;
}

.am-credits-grid-wrap .am-pagination a,
.am-credits-grid-wrap .am-pagination span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 12px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  border: 1px solid var(--am-border) !important;
  background: var(--am-surface) !important;
  color: var(--am-text) !important;
  transition: all 0.15s ease !important;
}

.am-credits-grid-wrap .am-pagination a:hover {
  border-color: var(--am-primary) !important;
  color: var(--am-primary) !important;
  background: var(--am-surface-subtle) !important;
}

.am-credits-grid-wrap .am-pagination .current {
  background: var(--am-primary) !important;
  color: #ffffff !important;
  border-color: var(--am-primary) !important;
  box-shadow: 0 2px 6px rgba(var(--am-primary-rgb, 79, 70, 229), 0.3) !important;
}

/* Dark mode overrides for credits page */
:root:not([data-theme="light"]) .am-credits-hero {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(6, 182, 212, 0.05)) !important;
  border-color: rgba(79, 70, 229, 0.3) !important;
}

:root:not([data-theme="light"]) .am-credits-kpi-card {
  background: #111726 !important;
  border-color: #1e293b !important;
}

:root:not([data-theme="light"]) .am-credits-ledger-card {
  background: #111726 !important;
  border-color: #1e293b !important;
}

:root:not([data-theme="light"]) .am-credits-grid-wrap .am-grid-container {
  background: #111726 !important;
  border-color: #1e293b !important;
}

:root:not([data-theme="light"]) .am-credits-grid-wrap .am-grid thead th {
  background: #172033 !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

:root:not([data-theme="light"]) .am-credits-grid-wrap .am-grid td {
  border-color: #1e293b !important;
  color: #e2e8f0 !important;
}

:root:not([data-theme="light"]) .am-credits-grid-wrap .am-grid tr.am-grid-row:hover td {
  background: #1c273e !important;
}

:root:not([data-theme="light"]) .am-credits-grid-wrap .am-pagination a,
:root:not([data-theme="light"]) .am-credits-grid-wrap .am-pagination span {
  background: #172033 !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

:root:not([data-theme="light"]) .am-credits-grid-wrap .am-pagination a:hover {
  border-color: var(--am-primary) !important;
  color: #ffffff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .am-credits-hero {
    padding: 18px 20px !important;
  }
  .am-credits-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .am-credits-kpi-card {
    padding: 16px 18px !important;
  }
  .am-credits-ledger-card {
    padding: 18px 20px !important;
  }
  .am-credits-grid-wrap .am-grid td,
  .am-credits-grid-wrap .am-grid thead th {
    padding: 10px 12px !important;
  }
}

@media (max-width: 480px) {
  .am-credits-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================================================
   Home Page & Hero Section Styles
   ========================================================================== */
.am-home-wrapper {
  width: 100%;
  box-sizing: border-box;
}

.hero-section {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 80px 20px 64px;
  background: linear-gradient(180deg, rgba(var(--am-primary-rgb, 79, 70, 229), 0.06) 0%, rgba(6, 182, 212, 0.03) 60%, transparent 100%);
  border-bottom: 1px solid var(--am-border);
}

.hero-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 740px;
  height: 380px;
  background: radial-gradient(circle, rgba(var(--am-primary-rgb, 79, 70, 229), 0.22) 0%, rgba(6, 182, 212, 0.12) 45%, transparent 70%);
  filter: blur(65px);
  pointer-events: none;
  z-index: 1;
}

.hero-headline {
  font-size: clamp(32px, 4.8vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 900px;
  margin: 0 auto 18px;
  color: var(--am-text);
  position: relative;
  z-index: 2;
}

.hero-headline .gradient,
span.gradient {
  background: linear-gradient(135deg, var(--am-primary) 0%, #06b6d4 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.hero-subhead {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--am-text-muted);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 34px;
  position: relative;
  z-index: 2;
}

.hero-search-wrap {
  max-width: 600px;
  margin: 0 auto 30px;
  position: relative;
  z-index: 2;
}

.hero-search-bar {
  display: flex;
  align-items: center;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: 999px;
  padding: 6px 8px 6px 20px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.hero-search-bar:focus-within {
  border-color: var(--am-primary);
  box-shadow: 0 0 0 4px rgba(var(--am-primary-rgb, 79, 70, 229), 0.15), 0 8px 24px -4px rgba(0, 0, 0, 0.08);
}

.hero-search-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 15px;
  color: var(--am-text);
  padding: 8px 0;
}

.hero-search-input::placeholder {
  color: var(--am-text-muted);
  opacity: 0.8;
}

.hero-search-btn {
  border-radius: 999px !important;
  padding: 10px 22px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

/* Category Pills Bar */
.category-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  color: var(--am-text-muted);
  transition: all 0.18s ease;
}

.cat-pill:hover,
.cat-pill.active {
  border-color: var(--am-primary);
  color: var(--am-primary);
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.08);
}

/* Dark mode overrides for Hero & Home */
:root:not([data-theme="light"]) .hero-section {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.12) 0%, rgba(6, 182, 212, 0.04) 60%, transparent 100%) !important;
}

:root:not([data-theme="light"]) .hero-glow {
  background: radial-gradient(circle, rgba(79, 70, 229, 0.3) 0%, rgba(6, 182, 212, 0.15) 50%, transparent 70%) !important;
}

:root:not([data-theme="light"]) .hero-search-bar {
  background: #111726 !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4) !important;
}

:root:not([data-theme="light"]) .cat-pill {
  background: #111726 !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

:root:not([data-theme="light"]) .cat-pill:hover,
:root:not([data-theme="light"]) .cat-pill.active {
  border-color: var(--am-primary) !important;
  color: #ffffff !important;
  background: rgba(79, 70, 229, 0.25) !important;
}

/* Responsive adjustments for Hero */
@media (max-width: 768px) {
  .hero-section {
    padding: 50px 16px 44px;
  }
  .hero-glow {
    width: 320px;
    height: 220px;
  }
  .hero-search-bar {
    padding: 4px 6px 4px 14px;
  }
  .hero-search-btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
  }
  .hero-stats-bar {
    gap: 18px !important;
    margin-top: 28px !important;
    padding-top: 20px !important;
  }
}


/* ==========================================================================
   Full-Bleed Seamless Home Page Overrides
   ========================================================================== */
.am-page-home .am-guest-content,
.am-page-home.am-logged-in .am-app-content,
.am-page-home .am-body-content,
.am-page-home .am-body-content-content {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
}

.am-page-home .hero-section {
  width: 100% !important;
  box-sizing: border-box !important;
}

.am-page-home .hero-headline {
  font-size: clamp(34px, 5.2vw, 56px) !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.035em !important;
  color: var(--am-text) !important;
  margin: 0 auto 20px !important;
  max-width: 920px !important;
  text-align: center !important;
}

.am-page-home .hero-subhead {
  font-size: clamp(16px, 1.8vw, 19px) !important;
  color: var(--am-text-muted) !important;
  line-height: 1.65 !important;
  max-width: 720px !important;
  margin: 0 auto 36px !important;
  text-align: center !important;
}

.am-page-home .hero-search-wrap {
  max-width: 640px !important;
  margin: 0 auto 30px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.am-page-home .hero-actions {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
  margin-bottom: 40px !important;
  width: 100% !important;
}

/* Custom Pages (Protect Content > Pages) Styling */
.am-content-page {
  max-width: 920px;
  margin: 32px auto 48px;
  padding: 36px 44px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: 18px;
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.05);
  line-height: 1.75;
  font-size: 15px;
  color: var(--am-text);
  box-sizing: border-box;
}

.am-content-page h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--am-text);
  margin-top: 0;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.am-content-page h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--am-text);
  margin-top: 28px;
  margin-bottom: 10px;
}

.am-content-page p {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--am-text);
}

.am-content-page ul, .am-content-page ol {
  padding-left: 24px;
  margin-bottom: 18px;
  color: var(--am-text);
}

.am-content-page li {
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .am-content-page {
    margin: 16px auto 32px;
    padding: 24px 20px;
    border-radius: 14px;
  }
}

/* ==========================================================================
   AMMODERN EXECUTIVE THEME OVERHAUL: PAY, THANKS & CREDIT CARD CHECKOUT PAGES
   ========================================================================== */

/* Page Containers */
.am-pay-page-container,
.am-thanks-page-container,
.am-cc-page-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 20px 64px;
  box-sizing: border-box;
}

/* Thanks page uses the same width as the member dashboard */
.am-thanks-page-container {
  max-width: 85%;
  padding-top: 8px;
}

@media (max-width: 1024px) {
  .am-thanks-page-container {
    max-width: 100%;
  }
}

/* Single-message states (waiting / review / signup) stay a centred card */
.am-thanks-page-container .am-thanks-card {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Page Headers */
.am-pay-header,
.am-cc-header {
  margin-bottom: 28px;
}

.am-pay-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.am-pay-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--am-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.am-pay-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.am-pay-ref-pill {
  font-size: 12.5px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--am-surface);
  color: var(--am-text);
  border: 1px solid var(--am-border);
}

.am-pay-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.am-pay-status-pill.am-status-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.am-pay-status-pill.am-status-active {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.am-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  animation: amDotBlink 1.4s infinite ease-in-out;
}

@keyframes amDotBlink {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.am-pay-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--am-text);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.am-pay-subtitle {
  font-size: 14.5px;
  color: var(--am-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Section Header in Cards */
.am-pay-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--am-text-muted);
  margin-bottom: 16px;
}

/* Pay Card */
.am-pay-card {
  padding: 32px;
  border-radius: 18px;
  box-shadow: var(--am-shadow-md);
  margin-bottom: 24px;
}

.am-pay-receipt-section {
  margin-bottom: 24px;
}

.am-pay-form-section {
  border-top: 1px solid var(--am-border);
  padding-top: 24px;
}

/* Receipt Component (.am-modern-receipt) */
.am-modern-receipt {
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  border-radius: 14px;
  overflow: hidden;
}

.am-modern-receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.am-modern-receipt-table th {
  background: var(--am-surface);
  color: var(--am-text-muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--am-border);
}

.am-modern-receipt-table th.am-receipt-qty,
.am-modern-receipt-table td.am-receipt-qty {
  text-align: center;
  width: 60px;
}

.am-modern-receipt-table th.am-receipt-unit-price,
.am-modern-receipt-table td.am-receipt-unit-price {
  text-align: right;
  width: 110px;
  color: var(--am-text-muted);
}

.am-modern-receipt-table th.am-receipt-price,
.am-modern-receipt-table td.am-receipt-price {
  text-align: right;
  width: 120px;
  font-weight: 700;
  color: var(--am-text);
}

.am-modern-receipt-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--am-border);
  color: var(--am-text);
  vertical-align: middle;
}

.am-receipt-item-row:hover td {
  background: rgba(79, 70, 229, 0.02);
}

.am-receipt-item-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--am-text);
}

.am-receipt-product-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.am-receipt-option-badge {
  font-size: 11.5px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--am-text-muted);
}

.am-qty-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  color: var(--am-text);
}

.am-receipt-summary-divider td {
  padding: 0;
  border-bottom: 1px solid var(--am-border);
}

.am-receipt-calc-row td {
  padding: 8px 18px;
  border-bottom: none;
  font-size: 13.5px;
}

.am-receipt-calc-label {
  text-align: right;
  color: var(--am-text-muted);
  font-weight: 600;
}

.am-receipt-calc-val {
  text-align: right;
  font-weight: 700;
  color: var(--am-text);
}

.am-receipt-row-total td {
  padding: 14px 18px;
  border-top: 1px dashed var(--am-border);
  border-bottom: 1px solid var(--am-border);
  background: var(--am-surface);
}

.am-receipt-total-label {
  text-align: right;
  font-size: 15px;
  font-weight: 800;
  color: var(--am-text);
}

.am-receipt-total-val {
  text-align: right;
}

.am-receipt-grand-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--am-primary);
  letter-spacing: -0.02em;
}

.am-receipt-row-terms td {
  padding: 12px 18px;
  background: var(--am-surface-subtle);
  border-bottom: none;
}

.am-receipt-terms-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--am-text-muted);
  line-height: 1.4;
}

.am-receipt-terms-badge strong {
  color: var(--am-text);
}

/* Pay Form & Button Styling */
#pay-form .am-row {
  margin: 0;
  padding: 0;
  border: none !important;
}

#pay-form input[type="submit"],
#pay-form button[type="submit"],
.am-pay-page-container .am-form input[type="submit"] {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 14px 28px !important;
  background: var(--am-primary) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 16px !important;
  border-radius: 12px !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3) !important;
  cursor: pointer !important;
  transition: var(--am-transition) !important;
}

#pay-form input[type="submit"]:hover,
#pay-form button[type="submit"]:hover,
.am-pay-page-container .am-form input[type="submit"]:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4) !important;
}

/* Security Bar */
.am-pay-security-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--am-border);
  font-size: 12px;
  color: var(--am-text-muted);
}

.am-pay-security-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.am-pay-security-item a {
  color: var(--am-text-muted);
  text-decoration: underline;
}

.am-pay-security-item a:hover {
  color: var(--am-primary);
}

/* Thanks Page Styling */
.am-thanks-card {
  padding: 44px 36px;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--am-shadow-lg);
  margin-bottom: 24px;
}

.am-thanks-hero-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.am-thanks-hero-icon.am-hero-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.am-thanks-hero-icon.am-hero-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

/* Pulsing animated clock icon for waiting state */
.am-thanks-pulse-icon {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.12);
  color: var(--am-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  animation: amThanksPulse 2s infinite ease-in-out;
}

@keyframes amThanksPulse {
  0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 18px rgba(79, 70, 229, 0); }
  100% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.am-thanks-card .am-thanks-badge-group {
  margin-bottom: 16px;
}

.am-thanks-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--am-text);
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.am-thanks-desc {
  font-size: 15px;
  color: var(--am-text-muted);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 28px;
}

.am-thanks-refresh-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 30px;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--am-text);
  margin-bottom: 24px;
}

.am-spin {
  animation: amSpin 1.8s linear infinite;
}

@keyframes amSpin {
  100% { transform: rotate(360deg); }
}

.am-thanks-notice-callout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--am-surface);
  border: 1px dashed var(--am-border);
  font-size: 12.5px;
  color: var(--am-text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* Thanks Details Grid */
.am-thanks-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
  text-align: left;
}

.am-thanks-detail-box {
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  border-radius: 12px;
  padding: 14px 16px;
}

.am-detail-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--am-text-muted);
  margin-bottom: 4px;
}

.am-detail-val {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--am-text);
}

.am-detail-val.am-code-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
}

.am-detail-val.am-total-highlight {
  color: var(--am-primary);
  font-size: 15px;
}

.am-thanks-receipt-wrapper {
  text-align: left;
  margin-bottom: 28px;
}

.am-thanks-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Thanks Guest Auth Box */
.am-thanks-auth-box {
  text-align: left;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}

.am-thanks-auth-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--am-text);
  margin-bottom: 12px;
}

.am-thanks-login-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

/* --- Confirmed order: wide dashboard-style layout --- */
.am-thanks-hero {
  display: block;
  padding: 30px 32px;
  margin-bottom: 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.10), rgba(var(--am-primary-rgb, 79, 70, 229), 0.06)) , var(--am-surface);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: var(--am-shadow-md);
}

.am-thanks-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
}

.am-thanks-hero-text {
  flex: 1;
  min-width: 0;
}

.am-thanks-hero .am-thanks-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0;
  flex-shrink: 0;
  box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.08);
}

.am-thanks-hero .am-thanks-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.am-thanks-hero .am-thanks-title {
  font-size: 26px;
  margin: 0 0 6px;
}

.am-thanks-hero .am-thanks-desc {
  max-width: 620px;
  margin: 0;
  font-size: 14.5px;
}

.am-thanks-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.am-thanks-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.am-thanks-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.am-thanks-main,
.am-thanks-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.am-thanks-panel {
  padding: 22px 24px;
  border-radius: var(--am-card-radius);
  box-shadow: var(--am-shadow-sm);
  margin: 0;
}

.am-thanks-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.am-thanks-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--am-text);
}

.am-thanks-panel-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--am-primary-light);
  color: var(--am-primary);
  flex-shrink: 0;
}

.am-thanks-panel-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--am-text-muted);
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
}

/* Receipt inside the panel: lighter frame */
.am-thanks-panel .am-modern-receipt {
  background: var(--am-surface);
  border-radius: 12px;
}

.am-thanks-panel .am-modern-receipt-table th {
  background: var(--am-surface-subtle);
}

.am-thanks-panel .am-modern-receipt-table td {
  background: transparent;
}

.am-thanks-panel .am-modern-receipt-table th {
  white-space: nowrap;
}

/* Key/value list (payment details, account) */
.am-thanks-info-list {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.am-thanks-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--am-border);
  font-size: 13.5px;
}

.am-thanks-info-row:first-child {
  padding-top: 0;
}

.am-thanks-info-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.am-thanks-info-row dt {
  color: var(--am-text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.am-thanks-info-row dd {
  margin: 0;
  color: var(--am-text);
  font-weight: 700;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.am-thanks-info-row dd.am-code-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
}

.am-thanks-info-total {
  margin-top: 6px;
  padding: 12px 14px !important;
  border: 0;
  border-radius: 10px;
  background: var(--am-primary-light);
  align-items: center;
}

.am-thanks-info-total dt {
  color: var(--am-text);
  font-weight: 700;
}

.am-thanks-info-total dd {
  color: var(--am-primary);
  font-size: 17px;
  font-weight: 800;
}

.am-thanks-muted {
  color: var(--am-text-muted);
  font-weight: 500;
}

.am-thanks-reveal {
  background: none;
  border: 0;
  padding: 0;
  color: var(--am-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.am-thanks-reveal:hover {
  text-decoration: underline;
}

/* What's next links */
.am-thanks-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.am-thanks-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  color: var(--am-text);
  text-decoration: none !important;
  transition: var(--am-transition);
}

.am-thanks-link:hover {
  border-color: rgba(var(--am-primary-rgb, 79, 70, 229), 0.35);
  background: var(--am-primary-light);
  transform: translateY(-1px);
}

.am-thanks-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--am-surface-subtle);
  color: var(--am-primary);
  flex-shrink: 0;
}

.am-thanks-link-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.am-thanks-link-text strong {
  font-size: 13.5px;
  font-weight: 700;
}

.am-thanks-link-text small {
  font-size: 12px;
  color: var(--am-text-muted);
}

.am-thanks-link-arrow {
  color: var(--am-text-faint);
  flex-shrink: 0;
}

.am-thanks-links-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

[data-theme="dark"] .am-thanks-info-total dd,
[data-theme="dark"] .am-thanks-panel .am-receipt-grand-total {
  color: #a5b4fc;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-thanks-info-total dd,
  [data-theme="system"] .am-thanks-panel .am-receipt-grand-total {
    color: #a5b4fc;
  }
}

.am-thanks-links-row .am-thanks-link {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
}

.am-thanks-links-row .am-thanks-link-text small {
  margin-top: 2px;
  line-height: 1.4;
}

.am-thanks-links-row .am-thanks-link-arrow {
  display: none;
}

@media (max-width: 1180px) {
  .am-thanks-links-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .am-thanks-links-row .am-thanks-link {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px;
  }

  .am-thanks-links-row .am-thanks-link-arrow {
    display: inline-block;
  }
}

@media (max-width: 1180px) {
  .am-thanks-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 960px) {
  .am-thanks-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .am-thanks-hero {
    padding: 22px 18px;
  }

  .am-thanks-hero-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .am-thanks-hero .am-thanks-title {
    font-size: 20px;
  }

  .am-thanks-hero-actions,
  .am-thanks-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .am-thanks-panel {
    padding: 18px 16px;
  }
}

/* ==========================================================================
   CREDIT CARD & STRIPE CHECKOUT PAGE
   ========================================================================== */
.am-cc-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.am-cc-page-header {
  margin-bottom: 24px;
}

.am-cc-header-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.am-cc-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--am-text);
  font-family: monospace;
}

.am-cc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 11.5px;
  font-weight: 700;
  color: #10b981;
}

.am-cc-main-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--am-text);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.am-cc-main-subtitle {
  font-size: 14px;
  color: var(--am-text-muted);
  margin: 0;
}

.am-cc-grid,
.am-cc-layout-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: start;
}

.am-cc-terminal,
.am-cc-terminal-card {
  padding: 32px;
  border-radius: 18px;
  background: var(--am-card-bg);
  border: 1px solid var(--am-border);
  box-shadow: var(--am-shadow-sm);
  min-width: 0;
}

.am-cc-terminal-head,
.am-cc-terminal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--am-border);
  padding-bottom: 18px;
}

.am-cc-terminal-title,
.am-cc-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--am-text);
  margin: 0 0 4px 0;
}

.am-cc-terminal-desc,
.am-cc-card-subtitle {
  font-size: 13px;
  color: var(--am-text-muted);
  margin: 0;
}

.am-cc-card-icons,
.am-cc-brands-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.am-card-pill,
.am-brand-card-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--am-surface-subtle);
  color: var(--am-text-muted);
  border: 1px solid var(--am-border);
}

/* Stripe Mount Containers - Clean Transparent Mounts */
#stripe-card-element,
#stripe-address-element {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
}

#stripe-address-element + br {
  display: none !important;
}

#stripe-address-element {
  margin-bottom: 16px !important;
}

.am-cc-elements-box form#cc .am-row,
.am-cc-form-wrapper form#cc .am-row {
  margin: 0 0 16px 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.am-cc-elements-box form#cc .am-row.am-no-label .am-element-title,
.am-cc-form-wrapper form#cc .am-row.am-no-label .am-element-title {
  display: none !important;
}

.am-cc-elements-box form#cc .am-row#row-qfauto-0 .am-element,
.am-cc-form-wrapper form#cc .am-row#row-qfauto-0 .am-element {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Submit Row and Buttons - Separate from Cancel Link */
#row-qfauto-4,
.am-cc-elements-box .am-row:last-child {
  margin-top: 24px !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

#row-qfauto-4 .am-element {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  width: 100% !important;
}

form#cc input[type="submit"],
form#cc input[type="submit"].am-cta-pay,
#row-qfauto-4 input[type="submit"] {
  width: 100% !important;
  padding: 15px 28px !important;
  background: var(--am-primary) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 15.5px !important;
  border-radius: 12px !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
  cursor: pointer !important;
  transition: var(--am-transition) !important;
  display: block !important;
  text-align: center !important;
  letter-spacing: -0.01em !important;
}

form#cc input[type="submit"]:hover,
#row-qfauto-4 input[type="submit"]:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45) !important;
}

#row-qfauto-4 a,
form#cc a[href*="cancel"] {
  display: inline-block !important;
  text-align: center !important;
  margin: 6px auto 0 !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--am-text-muted) !important;
  text-decoration: underline !important;
  transition: color 0.15s ease !important;
}

#row-qfauto-4 a:hover,
form#cc a[href*="cancel"]:hover {
  color: var(--am-text) !important;
}

/* Security Trust Badges in Terminal */
.am-cc-security-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--am-border);
}

.am-sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--am-text-muted);
}

.am-sec-badge i,
.am-sec-badge svg {
  color: #10b981;
}

/* Sidebar Order Summary */
.am-cc-summary-sidebar,
.am-cc-sidebar-card {
  width: 100%;
}

.am-cc-summary-card {
  padding: 24px;
  border-radius: 18px;
  background: var(--am-card-bg);
  border: 1px solid var(--am-border);
  box-shadow: var(--am-shadow-sm);
  position: sticky;
  top: 24px;
}

.am-cc-summary-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--am-border);
}

.am-cc-summary-head h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--am-text);
  margin: 0;
}

.am-cc-summary-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.am-cc-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.am-cc-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.am-cc-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--am-text);
  word-break: break-word;
}

.am-cc-item-terms {
  font-size: 11.5px;
  color: var(--am-text-muted);
  line-height: 1.4;
}

.am-cc-item-price-col {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}

.am-cc-qty-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--am-surface-subtle);
  color: var(--am-text-muted);
  border: 1px solid var(--am-border);
}

.am-cc-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--am-text);
  white-space: nowrap;
}

.am-cc-calc-lines {
  border-top: 1px solid var(--am-border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.am-cc-calc-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--am-text-muted);
}

.am-cc-calc-line .am-cc-calc-value {
  font-weight: 600;
  color: var(--am-text);
  white-space: nowrap;
}

.am-cc-total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px dashed var(--am-border);
}

.am-cc-total-label {
  font-size: 16px;
  font-weight: 800;
  color: var(--am-text);
}

.am-cc-total-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--am-primary);
  white-space: nowrap;
}

.am-cc-guarantee-list {
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.am-guarantee-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--am-text);
  line-height: 1.35;
}

.am-cc-support-link {
  text-align: center;
  font-size: 12px;
  color: var(--am-text-muted);
}

.am-cc-support-link a {
  color: var(--am-primary);
  font-weight: 600;
  text-decoration: none;
}

/* ==========================================================================
   MOBILE & PHONE VIEW RESPONSIVENESS (< 840px and < 640px)
   ========================================================================== */
@media (max-width: 840px) {
  .am-cc-grid,
  .am-cc-layout-grid {
    grid-template-columns: 1fr;
  }
  .am-cc-summary-sidebar,
  .am-cc-sidebar-card {
    order: -1;
  }
  .am-cc-summary-card {
    position: static !important;
  }
}

@media (max-width: 640px) {
  .am-pay-page-container,
  .am-thanks-page-container,
  .am-cc-page-container {
    padding: 18px 12px 40px;
  }

  .am-pay-card,
  .am-cc-terminal-card,
  .am-thanks-card {
    padding: 22px 16px;
    border-radius: 14px;
  }

  .am-pay-title,
  .am-thanks-title {
    font-size: 21px;
  }

  .am-pay-subtitle,
  .am-thanks-desc {
    font-size: 13.5px;
  }

  /* Responsive Receipt Table for Phones: Clean Stacked Layout */
  .am-modern-receipt-table thead {
    display: none;
  }

  .am-modern-receipt-table,
  .am-modern-receipt-table tbody,
  .am-modern-receipt-table tr.am-receipt-item-row {
    display: block;
    width: 100%;
  }

  .am-modern-receipt-table tr.am-receipt-item-row {
    padding: 14px;
    border-bottom: 1px solid var(--am-border);
  }

  .am-modern-receipt-table td.am-receipt-product {
    display: block;
    width: 100% !important;
    padding: 0 0 10px 0 !important;
    border-bottom: none !important;
  }

  .am-modern-receipt-table td.am-receipt-qty,
  .am-modern-receipt-table td.am-receipt-unit-price,
  .am-modern-receipt-table td.am-receipt-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    padding: 4px 0 !important;
    border-bottom: none !important;
    box-sizing: border-box;
  }

  .am-modern-receipt-table td.am-receipt-qty::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--am-text-muted);
  }

  .am-modern-receipt-table td.am-receipt-unit-price::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--am-text-muted);
  }

  .am-modern-receipt-table td.am-receipt-price::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
    color: var(--am-text);
  }

  /* Calculation Rows */
  .am-modern-receipt-table tr.am-receipt-calc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: none;
  }

  .am-modern-receipt-table tr.am-receipt-calc-row td.am-receipt-indent {
    display: none;
  }

  .am-modern-receipt-table tr.am-receipt-calc-row td.am-receipt-calc-label,
  .am-modern-receipt-table tr.am-receipt-calc-row td.am-receipt-calc-val {
    width: auto !important;
    padding: 0 !important;
  }

  /* Total Row on Phone */
  .am-modern-receipt-table tr.am-receipt-row-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px dashed var(--am-border);
  }

  .am-modern-receipt-table tr.am-receipt-row-total td.am-receipt-indent {
    display: none;
  }

  .am-modern-receipt-table tr.am-receipt-row-total td {
    width: auto !important;
    padding: 0 !important;
  }

  .am-receipt-grand-total {
    font-size: 18px;
  }

  /* Terms row on Phone */
  .am-modern-receipt-table tr.am-receipt-row-terms {
    display: block;
    padding: 10px 14px;
  }

  .am-modern-receipt-table tr.am-receipt-row-terms td {
    display: block;
    width: 100% !important;
    padding: 0 !important;
  }

  /* Thanks Details Grid on Phone */
  .am-thanks-details-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .am-thanks-detail-box {
    padding: 10px 12px;
  }

  .am-detail-val {
    font-size: 12px;
  }

  .am-thanks-actions {
    flex-direction: column;
    width: 100%;
  }

  .am-thanks-actions .btn {
    width: 100%;
    justify-content: center;
  }
}




/* ==========================================================================
   HELPDESK: BACK BUTTON & ATTACHMENT UPLOAD (Submit New Ticket / ticket view)
   ========================================================================== */
.am-helpdesk-main-card h1:first-child {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}
.am-helpdesk-main-card h1:first-child .am-grid-back-wrapper {
  margin-right: 2px !important;
}
/* Back: same recipe as .btn-secondary.btn-sm, with a Lucide arrow */
.am-helpdesk-main-card h1:first-child .am-grid-back.am-grid-back-styled {
  width: auto !important;
  height: 36px !important;
  padding: 0 12px 0 10px !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  color: var(--am-text) !important;
  background: var(--am-surface) !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transform: none !important;
}
.am-helpdesk-main-card h1:first-child .am-grid-back.am-grid-back-styled::before {
  content: none !important;
}
.am-helpdesk-main-card h1:first-child .am-grid-back.am-grid-back-styled .am-grid-back-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.am-helpdesk-main-card h1:first-child .am-grid-back.am-grid-back-styled:hover {
  background: var(--am-surface-subtle) !important;
  border-color: var(--am-text-muted) !important;
  color: var(--am-text) !important;
  transform: none !important;
}
.am-helpdesk-main-card h1:first-child .am-grid-back.am-grid-back-styled:hover .am-grid-back-icon {
  transform: translateX(-2px);
}
.am-helpdesk-main-card h1:first-child .am-grid-back.am-grid-back-styled:focus-visible {
  outline: 2px solid var(--am-primary) !important;
  outline-offset: 2px !important;
}
@media (max-width: 640px) {
  .am-helpdesk-main-card h1:first-child .am-grid-back.am-grid-back-styled {
    width: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  .am-helpdesk-main-card h1:first-child .am-grid-back.am-grid-back-styled .am-grid-back-label {
    display: none;
  }
}

/* Attachment widget (aMember amUpload): a button that looks like the theme's, and file chips */
.am-upload-widget {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.am-upload-widget .upload-control {
  display: block !important;
  float: none !important;
  margin: 0 !important;
  line-height: normal !important;
}
.am-upload-widget .upload-control::after {
  content: '';
  display: block;
  clear: both;
}
.am-upload-widget .upload-control .upload-control-upload,
.am-upload-widget .upload-control .upload-control-browse {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 38px !important;
  padding: 0 14px !important;
  float: none !important;
  box-sizing: border-box !important;
  border: 1px dashed rgba(var(--am-primary-rgb, 79, 70, 229), 0.3) !important;
  border-radius: 8px !important;
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.08) !important;
  background-image: none !important;
  color: var(--am-primary) !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  overflow: hidden !important;
  transition: all 0.15s ease !important;
}
.am-upload-widget .upload-control .upload-control-upload.hover,
.am-upload-widget .upload-control .upload-control-upload:hover,
.am-upload-widget .upload-control .upload-control-browse.hover,
.am-upload-widget .upload-control .upload-control-browse:hover {
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.15) !important;
  background-image: none !important;
  color: var(--am-primary-hover) !important;
}
[data-theme="dark"] .am-upload-widget .upload-control .upload-control-upload,
[data-theme="dark"] .am-upload-widget .upload-control .upload-control-browse {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  color: #818cf8 !important;
}
/* Core's "Add Attachments" reveal link is redundant: the attach control is always shown */
.am-helpdesk-form .am-row:has(> .am-element > .am-helpdesk-attachment-expand) {
  display: none !important;
}
.am-upload-widget .upload-control .upload-control-upload > span,
.am-upload-widget .upload-control .upload-control-browse > span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: none !important;
  padding: 0 !important;
}
.am-upload-widget .upload-control .upload-control-upload > span.uploading {
  /* keep the core spinner, sized to the button */
  width: 16px;
  height: 16px;
  background-size: 16px 16px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}
.am-upload-widget .am-upload-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.am-upload-widget .am-upload-hint {
  font-size: 12px;
  color: var(--am-text-muted);
  margin: 0;
}
.am-upload-widget .am-upload-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--am-border);
  border-radius: 10px;
  background: var(--am-surface);
  font-size: 13px;
  color: var(--am-text);
  min-width: 0;
}
.am-upload-widget .am-upload-file .am-upload-file-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--am-primary);
}
.am-upload-widget .am-upload-file a.link {
  font-weight: 600;
  color: var(--am-text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.am-upload-widget .am-upload-file a.link:hover {
  color: var(--am-primary);
}
.am-upload-widget .am-upload-file .am-upload-file-size {
  color: var(--am-text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.am-upload-widget .am-upload-file .am-link-del {
  margin-left: auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--am-text-muted);
  text-decoration: none;
  font-size: 13px;
  flex-shrink: 0;
  transition: var(--am-transition);
}
.am-upload-widget .am-upload-file .am-link-del:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
@media (max-width: 640px) {
  .am-upload-widget .upload-control .upload-control-upload,
  .am-upload-widget .upload-control .upload-control-browse {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   SELECT2 FIELDS (aMember's "Mobile Phone Number" brick: country code + number)
   ========================================================================== */
/* The real <select> stays in the page for screen readers, shrunk to 1px. The form rules
   above give every select width:100% and padding, which stretched it across the page
   (sideways scrollbar, stray line under the field), so it is pinned back here. */
.am-form select.select2-hidden-accessible,
.am-signup select.select2-hidden-accessible,
select.select2-hidden-accessible {
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* The visible box: same height, colours and corners as the other inputs */
.select2-container--default .select2-selection--single {
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--am-border);
  border-radius: var(--am-input-radius);
  background: var(--am-surface-subtle);
  transition: var(--am-transition);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 12px;
  padding-right: 24px;
  line-height: 1.4;
  font-size: 14px;
  font-weight: 600;
  color: var(--am-text);
}
/* nothing chosen yet: a hint instead of an empty box */
.select2-container--default .select2-selection--single .select2-selection__rendered:empty::before {
  content: "Code";
  font-weight: 500;
  color: var(--am-text-muted);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 0;
  right: 6px;
  height: 100%;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--am-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  background: var(--am-surface);
}

/* Country code next to the phone number: wide enough for codes like "+1-684" */
#am-mobile-area + .select2-container {
  flex: 0 0 auto;
  width: 104px !important;
}
/* code and number stay side by side on phones too (other field groups stack there) */
.am-element.group:has(> #am-mobile-area) {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start;
  gap: 10px !important;
}
.am-element.group > input[name="mobile_number"] {
  flex: 1 1 auto;
  min-width: 0;
}

/* The drop-down list */
.select2-dropdown {
  border: 1px solid var(--am-border);
  border-radius: 10px;
  background: var(--am-surface);
  color: var(--am-text);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  font-size: 13.5px;
}
.select2-container--default .select2-search--dropdown {
  padding: 8px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  padding: 8px 10px;
  border: 1px solid var(--am-border);
  border-radius: 8px;
  background: var(--am-surface-subtle);
  color: var(--am-text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--am-primary);
}
.select2-container--default .select2-results__option {
  padding: 8px 12px;
}
.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--selected {
  background: var(--am-surface-subtle);
  color: var(--am-text);
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--am-primary);
  color: #ffffff;
}
/* the label inside the box must not paint its own white background over the input colour */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  background: transparent !important;
}

/* Password strength bar: aMember draws its grey track 6px ABOVE the password field, where it
   looks like a stray line under the field before it (the phone number). It now sits along the
   bottom edge of the password field and shows only its coloured part while typing. */
.am-pass-indicator-wrap .am-pass-indicator-bar {
  top: auto !important;
  bottom: 3px;
  left: 10px;
  right: 10px;
  width: auto !important;
  background: transparent !important;
  border-radius: 3px;
  overflow: hidden;
  pointer-events: none;
}
.am-pass-indicator-wrap .am-pass-indicator-bar_bar {
  height: 3px;
  border-radius: 3px;
}

/* the blank first entry of a Select2 list (kept only while no country code is chosen) is not listed */
.select2-container--default .select2-results__option[role="option"]:empty,
.select2-container--default .select2-results__option[role="treeitem"]:empty {
  display: none;
}

/* ==========================================================================
   LOGIN & SIGNUP ON PHONES: the form comes first, the showcase panel sits below it
   ========================================================================== */
@media (max-width: 800px) {
  /* a card taller than the screen must start at the top instead of being centred off-screen */
  .am-auth-layout-shell {
    align-items: flex-start;
  }
  .am-auth-card .am-auth-card-form {
    order: 1;
  }
  .am-auth-card .am-auth-card-sidebar {
    order: 2;
    display: flex;
    padding: 28px 20px;
  }

  .am-signup-split-container .am-signup-form-card {
    order: 1;
  }
  .am-signup-split-container .am-signup-showcase {
    order: 2;
  }
}
@media (max-width: 1024px) {
  /* signup is one column from here down: the form comes first, the showcase below it */
  .am-signup-split-container .am-signup-form-card {
    order: 1;
  }
  .am-signup-split-container .am-signup-showcase {
    order: 2;
  }
}
@media (max-width: 640px) {
  /* signup shows two separate cards on phones: the gap now belongs above the showcase */
  .am-signup-split-container .am-signup-showcase {
    margin-top: 16px;
    margin-bottom: 0;
  }
}

/* ==========================================================================
   LOGIN CARD ON PHONES: nothing may be wider than the card
   The card is a flex item holding a one-column grid. Both can grow past the screen when
   something inside refuses to shrink; the card then gets centred and both sides are cut off
   (text starts at the very edge, the showcase heading loses its first letters).
   ========================================================================== */
.am-auth-layout-shell,
.am-auth-card,
.am-auth-card-form,
.am-auth-card-sidebar {
  min-width: 0;
  box-sizing: border-box;
}
.am-auth-card {
  max-width: min(940px, 100%);
}
/* aMember's amember.css fixes .am-auth-form at 450px (centred by auto margins, which the theme
   resets to 0). In the card that is either too wide (two columns: the fields and the Login button
   run past the card edge and get cut off) or too narrow (one column: an empty strip on the
   right). The login and forgot-password forms fill their column instead. */
.am-auth-card-form .am-auth-form,
.am-login-form-wrap .am-auth-form {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}
@media (max-width: 800px) {
  .am-auth-layout-shell {
    display: block;            /* no centring: the card simply fills the row */
    width: 100%;
  }
  .am-auth-card {
    max-width: min(680px, 100%); /* same width as the one-column signup card */
    margin: 0 auto;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    justify-items: stretch;
  }
  .am-auth-card .am-auth-card-form,
  .am-auth-card .am-auth-card-sidebar {
    width: auto;
    max-width: 100%;
    margin: 0;
    justify-self: stretch;
    overflow: hidden;
  }
  .am-auth-card .am-auth-card-form {
    padding: 30px 22px;
  }
  .am-auth-card .am-auth-card-sidebar {
    padding: 28px 22px;
  }
  /* long words and lines wrap inside the card instead of pushing it wider */
  .am-auth-card-form *,
  .am-auth-card-sidebar * {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .am-auth-card-form input[type="text"],
  .am-auth-card-form input[type="password"],
  .am-auth-card-form input[type="email"],
  .am-auth-card-form input[type="submit"],
  .am-auth-card-form button {
    width: 100%;
    box-sizing: border-box;
  }
}
@media (max-width: 800px) {
  /* stacked showcase: keep air between its text and the feature box below it */
  .am-auth-card .am-auth-card-sidebar {
    gap: 22px;
  }
}

/* ==========================================================================
   SIGNUP FORM: login hint, agreement tick box, Signup button
   ========================================================================== */
/* "Already have an account? log in" hint: accent tint instead of plain grey */
.am-signup-login-pill .am-info.am-login-text {
  background: rgba(var(--am-primary-rgb, 79, 70, 229), 0.08);
  border-color: rgba(var(--am-primary-rgb, 79, 70, 229), 0.25);
  color: var(--am-text);
}

/* Agreement tick box above the Signup button */
.am-signup-agree-row {
  padding: 6px 0 0 !important;
  margin: 4px 0 0 !important;
}
.am-signup-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--am-text-muted);
  cursor: pointer;
}
.am-signup-agree input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  margin: 1px 0 0 !important;
  padding: 0 !important;
  accent-color: var(--am-primary);
  cursor: pointer;
}
.am-signup-agree a {
  color: var(--am-primary);
  font-weight: 700;
  text-decoration: none;
}
.am-signup-agree a:hover {
  text-decoration: underline;
}
.am-signup-agree-error {
  display: none;
  margin: 6px 0 0 28px;
  font-size: 12.5px;
  font-weight: 600;
  color: #dc2626;
}
.am-signup-agree-error.am-shown {
  display: block;
}

/* Signup button: same size as the Login button on the login page */
.am-signup-form-wrapper .am-cta-signup {
  min-height: 50px !important;
}

/* Side-by-side fields (first + last name, country code + phone) in the error state:
   the messages go on their own line below the fields instead of squeezing the fields */
.am-form .am-element.group {
  flex-wrap: wrap;
}
.am-form .am-element.group > span.am-error {
  flex: 1 1 calc(50% - 6px);
  min-width: 0;
  margin: 0;
}
.am-element.group:has(> #am-mobile-area) {
  flex-wrap: wrap !important;
}
.am-element.group > input[name="mobile_number"] {
  flex: 1 1 120px;
  width: auto !important;
  min-width: 0;
}
.am-element.group:has(> #am-mobile-area) > span.am-error {
  flex: 0 0 100%;
}
/* the two fields keep their half of the row, so the messages wrap underneath them */
.am-form .am-element.group > input[type="text"]:not([name="mobile_number"]),
.am-form .am-element.group > input[type="password"],
.am-form .am-element.group > input[type="email"] {
  min-width: calc(50% - 6px);
}

/* ==========================================================================
   CAPTCHA ON THE SIGNUP AND LOGIN FORMS
   ========================================================================== */
/* signup: no "Anti Spam" title, widget centred like on the login page */
#row-grp-captcha .am-element-title {
  display: none !important;
}
#row-grp-captcha .am-element,
#row-grp-captcha .am-element > * {
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 100%;
}
#row-grp-captcha {
  padding: 10px 0 4px !important;
}

/* Login / Signup button while the captcha is not solved yet (theme.js switches it) */
input[type="submit"].am-wait-captcha,
button.am-wait-captcha {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Invisible captcha (theme option): the rows take no room in the form, but they are NOT hidden.
   Google puts its badge (fixed to the bottom right of the window) inside the row, and a hidden
   row would hide the badge as well. */
.am-captcha-invisible #row-grp-captcha,
.am-captcha-invisible #login-recaptcha-row,
.am-captcha-invisible .am-row-recaptcha {
  display: block !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: visible !important;
}
.am-captcha-invisible #row-grp-captcha .am-element,
.am-captcha-invisible #row-grp-captcha .am-element > * {
  display: block !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* the badge itself: above page content, below pop-ups */
.grecaptcha-badge {
  z-index: 50;
}

/* ===== Tool page: "Verify your WhatsApp" card (AMModern WhatsApp plugin) =====
   desktop: icon | text | button in one row, as wide as the cards above;
   tablet/phone: stacked and centred */
.tool-launch-bar .am-wa-gate {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  text-align: left;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 211, 102, .35);
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 211, 102, .16), transparent 45%),
    linear-gradient(135deg, rgba(37, 211, 102, .09), rgba(18, 140, 126, .03));
}
.am-wa-gate::before { /* green accent on the left edge */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #25d366, #128c7e);
}
.am-wa-gate-icon {
  position: relative;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #25d366, #1ebe5b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -4px rgba(37, 211, 102, .5);
}
.am-wa-gate-lock {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--am-surface, #fff);
  color: #128c7e;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .15);
}
.am-wa-gate-text { flex: 1 1 auto; min-width: 0; }
.am-wa-gate-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--am-text);
  line-height: 1.3;
  margin-bottom: 4px;
}
.am-wa-gate-desc {
  font-size: 13.5px;
  color: var(--am-text-muted);
  line-height: 1.55;
}
.am-wa-gate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.am-wa-gate-chips span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #128c7e;
  background: rgba(37, 211, 102, .12);
  border: 1px solid rgba(37, 211, 102, .25);
}
[data-theme="dark"] .am-wa-gate-chips span { color: #4ade80; }
.am-wa-gate-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  background: #25d366;
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 6px 18px -2px rgba(37, 211, 102, .45);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.am-wa-gate-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 24px -4px rgba(37, 211, 102, .55);
}
.am-wa-gate-btn svg:last-child { transition: transform .15s ease; }
.am-wa-gate-btn:hover svg:last-child { transform: translateX(3px); }
@media (max-width: 767px) {
  .tool-launch-bar .am-wa-gate {
    flex-direction: column;
    text-align: center;
    padding: 22px 20px;
    gap: 14px;
  }
  .am-wa-gate::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 4px; }
  .am-wa-gate-chips { justify-content: center; }
  .am-wa-gate-btn { width: 100%; }
}

/* ==========================================================================
   INVOICES & RECEIPTS TABLE (/invoices)
   Wide: normal table. Narrow (phones, tablets, small laptops with the sidebar):
   one compact line per invoice, tap to open details. 10 per page + pager.
   ========================================================================== */
.am-inv-table-wrap {
  overflow-x: auto;
  container-type: inline-size;
  container-name: am-inv;
}

.am-inv-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.am-inv-table thead tr {
  border-bottom: 1px solid var(--am-border);
  background: var(--am-surface-subtle);
}

.am-inv-table th {
  padding: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--am-text-muted);
  white-space: nowrap;
}

.am-inv-table td {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--am-text);
  vertical-align: middle;
}

.am-inv-table tbody tr {
  border-bottom: 1px solid var(--am-border);
  transition: background 0.15s ease;
}

.am-inv-table tbody tr:last-child {
  border-bottom: 0;
}

.am-inv-table tbody tr:hover {
  background: var(--am-surface-hover);
}

.am-inv-table tbody tr:hover td {
  background: transparent;
}

.am-inv-table td.am-inv-amount {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

/* currency sign, then a clear gap before the amount */
.am-inv-table .am-inv-cur {
  margin-right: 4px;
}

/* the service name is the bold part of a row */
.am-inv-table td.am-inv-items strong {
  font-weight: 700;
}

.am-inv-table td.am-inv-date,
.am-inv-table td.am-inv-method,
.am-inv-table td.am-inv-renew {
  color: var(--am-text-muted);
  white-space: nowrap;
}

.am-inv-table td.am-inv-renew {
  font-weight: 600;
  color: var(--am-text);
}

.am-inv-table .am-inv-none {
  color: var(--am-text-muted);
  font-weight: 400;
}

/* Refunded payments: the whole row in #e5c3c6, dark text so it reads in light and dark mode */
.am-inv-table tbody tr.is-refunded td,
.am-inv-table tbody tr.is-refunded:hover td {
  background: #e5c3c6 !important;
  color: #3b1f24 !important;
}
.am-inv-table tbody tr.is-refunded td .am-inv-none {
  color: #6b4148;
}

.am-inv-table td.am-inv-items {
  max-width: 260px;
}

.am-inv-table .am-inv-col-pdf {
  text-align: right;
}

/* The tap-to-open arrow only exists in the compact layout */
.am-inv-table .am-inv-toggle {
  display: none;
}

.am-inv-badge {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.am-inv-badge-paid {
  background: #dcfce7;
  color: #15803d;
}

.am-inv-badge-refunded {
  background: #fef3c7;
  color: #b45309;
}

.am-inv-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ---------- Compact list (table area narrower than its columns) ---------- */
@container am-inv (max-width: 879px) {
  .am-inv-table thead {
    display: none;
  }

  .am-inv-table,
  .am-inv-table tbody {
    display: block;
    width: 100%;
  }

  .am-inv-table tbody {
    border: 1px solid var(--am-border);
    border-radius: 12px;
    overflow: hidden;
  }

  /* One line per payment:  plan / date  ·····  amount  ⌄ */
  .am-inv-table tbody tr.am-inv-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 28px;
    column-gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--am-border);
    -webkit-tap-highlight-color: transparent;
  }

  .am-inv-table tbody tr.am-inv-row:last-child {
    border-bottom: 0;
  }

  .am-inv-table tbody tr.am-inv-row.is-open {
    background: var(--am-surface-subtle);
  }

  .am-inv-table td {
    padding: 0;
    border: 0;
    max-width: none !important;
    min-width: 0;
  }

  .am-inv-table td.am-inv-date {
    grid-column: 1;
    grid-row: 2;
    font-size: 12px;
    margin-top: 2px;
  }

  .am-inv-table td.am-inv-amount {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    text-align: right;
    font-size: 14px;
  }

  /* Plan name on top of the closed line, the date under it */
  .am-inv-table td.am-inv-items {
    grid-column: 1;
    grid-row: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .am-inv-table td.am-inv-items strong {
    font-weight: 700;
  }

  .am-inv-table tbody tr.am-inv-row.is-refunded {
    background: #e5c3c6;
  }

  /* Refunded payments: amount struck through so it shows without the badge */
  .am-inv-table tr.is-refunded td.am-inv-amount {
    text-decoration: line-through;
    color: var(--am-text-muted);
  }

  .am-inv-table td.am-inv-toggle {
    display: flex;
    grid-column: 3;
    grid-row: 1 / span 2;
    align-items: center;
    justify-content: center;
  }

  .am-inv-table .am-inv-toggle-btn {
    width: 28px;
    height: 28px;
    min-height: 0;
    border-radius: 8px;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0;
    background: transparent !important;
    color: var(--am-text-muted) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: none;
    transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  }

  .am-inv-table tr.am-inv-row:hover .am-inv-toggle-btn,
  .am-inv-table .am-inv-toggle-btn:focus-visible {
    background: var(--am-primary-light) !important;
    color: var(--am-primary) !important;
  }

  .am-inv-table .am-inv-row.is-open .am-inv-toggle-btn {
    transform: rotate(180deg);
    color: var(--am-primary) !important;
  }

  /* Details: hidden until the line is opened */
  .am-inv-table td.am-inv-method,
  .am-inv-table td.am-inv-renew,
  .am-inv-table td.am-inv-col-pdf {
    display: none;
    grid-column: 1 / -1;
  }

  .am-inv-row.is-open td.am-inv-method,
  .am-inv-row.is-open td.am-inv-renew {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px dashed var(--am-border);
    text-align: right;
    white-space: normal;
  }

  .am-inv-row.is-open td.am-inv-method {
    margin-top: 12px;
  }

  .am-inv-row.is-open td.am-inv-method::before,
  .am-inv-row.is-open td.am-inv-renew::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--am-text-muted);
    text-align: left;
    flex-shrink: 0;
  }

  .am-inv-row.is-open td.am-inv-col-pdf {
    display: block;
    padding-top: 8px;
  }

  .am-inv-table td.am-inv-col-pdf .am-inv-pdf-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Pager ---------- */
.am-inv-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.am-inv-pager-info {
  font-size: 13px;
  color: var(--am-text-muted);
}

.am-inv-pager-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.am-inv-page {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--am-btn-radius);
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  color: var(--am-text);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  box-sizing: border-box;
  transition: var(--am-transition);
}

a.am-inv-page:hover {
  border-color: var(--am-primary);
  color: var(--am-primary);
  background: var(--am-primary-light);
}

.am-inv-page.is-current {
  background: var(--am-primary);
  border-color: var(--am-primary);
  color: #fff;
}

.am-inv-page.is-disabled {
  opacity: 0.4;
  cursor: default;
}

.am-inv-page-nav {
  padding: 0;
}

.am-inv-page-gap {
  color: var(--am-text-faint);
  padding: 0 2px;
}

@media (max-width: 640px) {
  .am-inv-pager {
    flex-direction: column-reverse;
    align-items: center;
  }
}

/* ==========================================================================
   COMPANY & INVOICING CARD (/invoices, /billing)
   ========================================================================== */
.am-company-display-card {
  margin-top: 24px;
}

.am-company-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.am-company-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -2px rgba(6, 182, 212, 0.35);
}

.am-company-card-heading {
  flex: 1;
  min-width: 0;
}

.am-company-card-title {
  font-size: 16px;
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--am-text);
  line-height: 1.3;
}

.am-company-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0369a1;
}

.am-company-display-card .am-btn-company-edit {
  flex-shrink: 0;
}

.am-company-card-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.am-company-card-item {
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 0;
}

.am-company-card-item dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--am-text-muted);
  margin-bottom: 3px;
}

.am-company-card-item dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--am-text);
  overflow-wrap: anywhere;
}

[data-theme="dark"] .am-company-card-badge {
  color: #7dd3fc;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-company-card-badge {
    color: #7dd3fc;
  }
}

@media (max-width: 760px) {
  /* icon + heading on top, then details, then a full-width button */
  .am-company-display-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
  }

  .am-company-card-head {
    display: contents;
  }

  .am-company-card-icon {
    grid-column: 1;
    grid-row: 1;
  }

  .am-company-card-heading {
    grid-column: 2;
    grid-row: 1;
  }

  .am-company-card-details {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .am-company-display-card .am-btn-company-edit {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    justify-content: center;
  }

  /* Details become a simple label / value list */
  .am-company-card-details {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 14px 0;
    border: 1px solid var(--am-border);
    border-radius: 10px;
    overflow: hidden;
  }

  .am-company-card-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 10px 12px;
    border-bottom: 1px dashed var(--am-border);
  }

  .am-company-card-item:last-child {
    border-bottom: 0;
  }

  .am-company-card-item dt {
    flex-shrink: 0;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
  }

  .am-company-card-item dd {
    text-align: right;
    font-size: 13px;
  }
}

/* Invoices page header buttons: wrap instead of running off the card */
.am-inv-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .am-inv-head-actions {
    width: 100%;
  }

  .am-inv-head-actions > * {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ==========================================================================
   PROFILE: FIELDS LOCKED AFTER WHATSAPP VERIFICATION
   (classes added by the AMModern WhatsApp plugin)
   ========================================================================== */
.am-page-profile input.am-field-locked,
.am-modern-form-wrapper input.am-field-locked {
  background-color: var(--am-surface-subtle) !important;
  border-style: dashed !important;
  color: var(--am-text-muted) !important;
  cursor: not-allowed;
  padding-right: 38px !important;
  /* small padlock at the right edge */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px 16px !important;
  box-shadow: none !important;
}

.am-page-profile input.am-field-locked:focus {
  border-color: var(--am-border) !important;
  box-shadow: none !important;
}

/* a locked field looks the same after a click: no blinking text cursor, no focus ring, and the
   padlock stays (.am-form input:focus resets the whole background with !important) */
.am-page-profile input.am-field-locked,
.am-modern-form-wrapper input.am-field-locked {
  caret-color: transparent;
}
.am-page-profile .am-form input.am-field-locked:focus,
.am-modern-form-wrapper .am-form input.am-field-locked:focus {
  outline: none !important;
  background-color: var(--am-surface) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px 16px !important;
}

/* disabled country-code picker next to a locked phone number */
.am-row-locked .select2-container--default.select2-container--disabled .select2-selection--single,
.am-row-locked .select2-container--disabled .select2-selection {
  background-color: var(--am-surface-subtle) !important;
  border-style: dashed !important;
  cursor: not-allowed;
}

.am-row-locked .select2-container--disabled .select2-selection__arrow {
  display: none;
}

/* verified phone (read-only, shown instead of the editable phone field) */
.am-locked-phone {
  position: relative;
  display: flex;
  align-items: center;
}

.am-locked-phone input.am-field-locked {
  width: 100%;
  padding-right: 190px !important;
  background-position: right 12px center !important;
  font-variant-numeric: tabular-nums;
  color: var(--am-text) !important;
  font-weight: 600;
}

.am-locked-badge {
  position: absolute;
  right: 38px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  pointer-events: none;
}

/* phone row labels hidden, like the name and e-mail rows (placeholder / badge says what it is) */
.am-page-profile .am-row:has(#am-mobile-area) > .am-element-title,
.am-page-profile .am-row:has(.am-locked-phone) > .am-element-title {
  display: none !important;
}

/* note under the locked fields / hint under the phone before verification */
.am-lock-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--am-text-muted);
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
}

.am-lock-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--am-text-faint);
}

.am-lock-note a {
  color: var(--am-primary);
  font-weight: 600;
}

.am-lock-note-pending {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

.am-lock-note-pending svg {
  color: #10b981;
}

[data-theme="dark"] .am-locked-badge {
  color: #34d399;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-locked-badge {
    color: #34d399;
  }
}

@media (max-width: 480px) {
  /* badge moves under the number on narrow phones */
  .am-locked-phone {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .am-locked-phone input.am-field-locked {
    padding-right: 38px !important;
  }

  .am-locked-badge {
    position: static;
    transform: none;
    align-self: flex-start;
  }
}

/* ==========================================================================
   PROFILE PAGE (member/profile.phtml): banner card with photo, name, contact and
   status chips, the Profile / Security tabs under it, then the form in its own card
   ========================================================================== */
.am-pf {
  width: 100%;
  padding-bottom: 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.am-pf .dash-card {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: 16px;
  box-sizing: border-box;
  min-width: 0;
}
.am-pf-main { padding: 32px; }

/* banner */
.am-pf-hero { padding: 0; overflow: hidden; }
.am-pf-cover {
  height: 132px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.25), transparent 45%),
    linear-gradient(120deg, var(--am-primary), var(--am-accent));
}
.am-pf-hero-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 0 32px;
}
.am-pf-avatar {
  position: relative;
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  margin-top: -56px;              /* only the photo overlaps the cover */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--am-surface);
  box-shadow: var(--am-shadow-md);
  background: linear-gradient(135deg, var(--am-primary), var(--am-accent));
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.am-pf-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.am-pf-hero-text { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; min-width: 0; }
.am-pf-hero-name { margin: 0; font-size: 24px; font-weight: 800; color: var(--am-text); line-height: 1.2; overflow-wrap: anywhere; }
.am-pf-hero-sub { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--am-text-muted); }
.am-pf-hero-sub span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.am-pf-hero-sub svg { width: 14px; height: 14px; flex-shrink: 0; }

/* status chips */
.am-pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.am-pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  color: var(--am-text-muted);
  white-space: nowrap;
}
.am-pf-chip svg { width: 13px; height: 13px; }
.am-pf-chip-ok { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); color: #047857; }
.am-pf-chip-warn { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); color: #b45309; }
[data-theme="dark"] .am-pf-chip-ok { color: #34d399; }
[data-theme="dark"] .am-pf-chip-warn { color: #fbbf24; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-pf-chip-ok { color: #34d399; }
  [data-theme="system"] .am-pf-chip-warn { color: #fbbf24; }
}

/* underlined tabs along the bottom of the banner (base .am-profile-tab-btn rules use !important) */
.am-pf-tabs {
  display: flex;
  gap: 4px;
  margin-top: 22px;
  padding: 0 24px;
  border-top: 1px solid var(--am-border);
}
.am-pf-tabs .am-profile-tab-btn {
  border-radius: 0 !important;
  padding: 14px 12px 12px !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
}
.am-pf-tabs .am-profile-tab-btn:hover { background: transparent !important; }
.am-pf-tabs .am-profile-tab-btn.active {
  background: transparent !important;
  color: var(--am-primary) !important;
  border-bottom-color: var(--am-primary) !important;
  box-shadow: none !important;
}

/* phones: centred banner, tabs share the width */
@media (max-width: 640px) {
  .am-pf-main { padding: 22px 16px; }
  .am-pf-hero-body { flex-direction: column; align-items: center; text-align: center; padding: 0 16px; gap: 0; }
  .am-pf-hero-text { padding-top: 12px; }
  .am-pf-hero-sub, .am-pf-chips { justify-content: center; }
  .am-pf-avatar { width: 96px; height: 96px; margin-top: -48px; font-size: 32px; }
  .am-pf-tabs { padding: 0 8px; }
  .am-pf-tabs .am-profile-tab-btn { flex: 1; justify-content: center !important; padding: 12px 6px !important; font-size: 13px !important; }
}
@media (max-width: 440px) {
  /* both tabs on one line: labels only */
  .am-pf-tabs .am-profile-tab-btn { white-space: nowrap; }
  .am-pf-tabs .am-profile-tab-btn svg { display: none; }
}

/* ==========================================================================
   PROFILE DETAILS INPUTS (member/profile.phtml, Profile Details tab):
   white outlined fields with a focus ring; locked fields stay white with grey
   text and the padlock; the lock message is plain text under the phone
   ========================================================================== */
.am-pf #am-profile-form-container.am-tab-mode-profile :is(#row-name-0, #row-email-0, .am-row:has(.am-locked-phone), .am-row:has(#am-mobile-area)) {
  margin-bottom: 16px !important;
}
.am-pf #am-profile-form-container.am-tab-mode-profile :is(#row-name-0, #row-email-0, .am-row:has(.am-locked-phone), .am-row:has(#am-mobile-area)) input[type="text"],
.am-pf #am-profile-form-container.am-tab-mode-profile :is(#row-name-0, #row-email-0, .am-row:has(.am-locked-phone), .am-row:has(#am-mobile-area)) .select2-selection {
  height: 48px !important;
  background-color: var(--am-surface) !important;
  border: 1.5px solid var(--am-border) !important;
  border-radius: 10px !important;
  padding-left: 16px !important;
  font-size: 14.5px !important;
  box-shadow: none !important;
}
.am-pf #am-profile-form-container.am-tab-mode-profile :is(#row-name-0, #row-email-0, .am-row:has(.am-locked-phone), .am-row:has(#am-mobile-area)) input[type="text"]:not(.am-field-locked):focus {
  border-color: var(--am-primary) !important;
  box-shadow: 0 0 0 4px rgba(var(--am-primary-rgb, 79, 70, 229), 0.12) !important;
}
.am-pf #am-profile-form-container.am-tab-mode-profile :is(#row-name-0, #row-email-0, .am-row:has(.am-locked-phone), .am-row:has(#am-mobile-area)) input.am-field-locked {
  border-style: solid !important;
  background-color: var(--am-surface) !important;
  color: var(--am-text-muted) !important;
}
.am-pf #am-profile-form-container.am-tab-mode-profile .am-lock-note {
  background: none !important;
  border: none !important;
  padding: 0 2px !important;
  margin-top: 10px;
}

/* ==========================================================================
   SECURITY & PASSWORD TAB (member/profile.phtml): password form on the left,
   a side panel with sign-in activity and protection status on the right
   ========================================================================== */
/* things that belong to the Security tab only */
.am-pf-main:not(:has(#am-profile-form-container.am-tab-mode-security)) .am-sec-only { display: none !important; }


/* password fields: label above, short placeholder, outlined, show/hide button */
.am-pf-main #am-profile-form-container.am-tab-mode-security :is(#row-_oldpass-0, #row-pass-0, #row-pass-confirm) { margin-bottom: 16px !important; }
.am-pf-main #am-profile-form-container.am-tab-mode-security :is(#row-_oldpass-0, #row-pass-0, #row-pass-confirm) > .am-element-title { display: block !important; margin: 0 0 7px !important; font-size: 13px !important; font-weight: 600 !important; color: var(--am-text) !important; }
.am-pf-main #am-profile-form-container.am-tab-mode-security :is(#row-_oldpass-0, #row-pass-0, #row-pass-confirm) > .am-element-title .comment { display: none !important; }
.am-pf-main #am-profile-form-container.am-tab-mode-security :is(#row-_oldpass-0, #row-pass-0, #row-pass-confirm) input {
  height: 48px !important;
  background: var(--am-surface) !important;
  border: 1.5px solid var(--am-border) !important;
  border-radius: 10px !important;
  padding: 0 46px 0 16px !important;
  font-size: 14.5px !important;
  box-shadow: none !important;
}
.am-pf-main #am-profile-form-container.am-tab-mode-security :is(#row-_oldpass-0, #row-pass-0, #row-pass-confirm) input:focus {
  border-color: var(--am-primary) !important;
  box-shadow: 0 0 0 4px rgba(var(--am-primary-rgb, 79, 70, 229), 0.12) !important;
}
.am-sec-pass { position: relative; }
.am-sec-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px !important;     /* phone rules stretch form buttons to full width */
  min-width: 0 !important;
  max-width: 34px !important;
  height: 34px !important;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  border-radius: 8px;
  background: transparent !important;
  color: var(--am-text-muted);
  cursor: pointer;
  padding: 0 !important;
  box-shadow: none !important;
}
.am-sec-eye:hover { color: var(--am-primary); background: var(--am-surface-subtle) !important; }

/* two columns on the Security tab */
.am-pf-main:has(#am-profile-form-container.am-tab-mode-security) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  column-gap: 28px;
  grid-auto-flow: row dense;
  align-items: start;
}
.am-pf-main:has(#am-profile-form-container.am-tab-mode-security) > * { grid-column: 1 / -1; }
.am-pf-main:has(#am-profile-form-container.am-tab-mode-security) > #am-profile-form-container { grid-column: 1; }
.am-pf-main:has(#am-profile-form-container.am-tab-mode-security) > .am-sec-aside { grid-column: 2; }
.am-sec-aside {
  padding: 18px;
  border: 1px solid var(--am-border);
  border-radius: 14px;
  background: var(--am-surface-subtle);
}
.am-sec-aside h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--am-text-muted); }
.am-sec-aside h4:not(:first-child) { margin-top: 18px; }
.am-sec-facts { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.am-sec-facts dt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--am-text-muted); }
.am-sec-facts dt svg { width: 13px; height: 13px; }
.am-sec-facts dd { margin: 2px 0 0 19px; font-size: 13.5px; font-weight: 600; color: var(--am-text); overflow-wrap: anywhere; }
.am-sec-protect { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.am-sec-protect li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--am-text); }
.am-sec-protect li > span:first-child { flex: 1; min-width: 120px; }
.am-sec-protect a { font-size: 12.5px; font-weight: 700; color: var(--am-primary); }
.am-sec-tip { display: flex; gap: 8px; margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed var(--am-border); font-size: 12.5px; color: var(--am-text-muted); line-height: 1.45; }
.am-sec-tip svg { width: 15px; height: 15px; flex-shrink: 0; color: #d97706; }

/* narrower screens: the panel moves under the form */
@media (max-width: 960px) {
  .am-pf-main:has(#am-profile-form-container.am-tab-mode-security) { display: block; }
  .am-sec-aside { margin-top: 8px; }
}

/* ==========================================================================
   COMPANY & INVOICING MODAL: country and state pickers (select2) look like
   the other fields of the modal (white, 42px, 8px corners, normal weight)
   ========================================================================== */
#am-company-modal .select2-container--default .select2-selection--single {
  height: 42px;
  border-radius: 8px;
  background: var(--am-surface);
}
#am-company-modal .select2-container--default .select2-selection--single .select2-selection__rendered {
  font-weight: 400;
  padding-right: 44px;
}
#am-company-modal .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--am-text-muted);
}
/* the "Code" hint is for the phone country code only */
#am-company-modal .select2-container--default .select2-selection--single .select2-selection__rendered:empty::before {
  content: none;
}
#am-company-modal .select2-container--default .select2-selection--single .select2-selection__clear {
  margin-right: 4px;
  color: var(--am-text-muted);
  font-size: 16px;
}
#am-company-modal .select2-dropdown {
  border-radius: 8px;
}

/* ==========================================================================
   FORM FIELDS USE THE THEME FONT
   aMember's amember.css gives inputs, selects, textareas and buttons inside the page and pop-ups
   Tahoma (and jQuery UI widgets Tahoma with !important); other buttons get the browser's Arial.
   Fields that ask for monospace in their own style (affiliate links) keep it.
   ========================================================================== */
input:not([style*="monospace"]),
select,
textarea:not([style*="monospace"]),
button,
optgroup,
.select2-container,
.select2-dropdown,
.ui-widget,
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
  font-family: var(--am-font-sans) !important;
}

/* ==========================================================================
   BILLING: SUBSCRIPTION CARDS (member/billing.phtml)
   ========================================================================== */
.am-sub-list { display: flex; flex-direction: column; gap: 14px; }
.am-sub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid var(--am-border);
  border-radius: 14px;
  background: var(--am-surface);
  overflow: hidden;
}
.am-sub-card::before { /* status stripe on the left edge */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--am-border);
}
.am-sub-card.is-active::before { background: #16a34a; }
.am-sub-card.is-cancelled::before { background: #f59e0b; }
.am-sub-card.is-failed::before { background: #dc2626; }

.am-sub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.am-sub-title-wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.am-sub-title { margin: 0; font-size: 17px; font-weight: 800; color: var(--am-text); overflow-wrap: anywhere; }
.am-sub-order { font-size: 12.5px; color: var(--am-text-muted); font-weight: 600; }
.am-sub-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.am-sub-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.am-sub-status.is-active { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.am-sub-status.is-cancelled { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.am-sub-status.is-failed { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.am-sub-status.is-ended { background: var(--am-surface-subtle); color: var(--am-text-muted); }

.am-sub-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; color: var(--am-text-muted); font-size: 13.5px; margin-top: -4px; }
.am-sub-price strong { font-size: 22px; font-weight: 800; color: var(--am-text); letter-spacing: -0.01em; }
.am-sub-cur { margin-right: 3px; }
.am-sub-kind {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  color: var(--am-text-muted);
}
.am-sub-card.is-cancelled .am-sub-price strong { color: var(--am-text-muted); }
.am-sub-first { margin-top: -8px; font-size: 12.5px; color: var(--am-text-muted); }
.am-sub-items { display: flex; flex-wrap: wrap; gap: 6px; }
.am-sub-items span { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--am-primary-light); color: var(--am-primary); }

.am-sub-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
}
.am-sub-facts dt { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--am-text-muted); margin: 0 0 2px; }
.am-sub-facts dd { margin: 0; font-size: 13.5px; color: var(--am-text); overflow-wrap: anywhere; }
.am-sub-facts dd.am-sub-strong { font-weight: 700; }
.am-sub-card.is-active .am-sub-facts dd.am-sub-strong { color: var(--am-primary); }

.am-sub-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--am-text);
}
.am-sub-note svg { flex-shrink: 0; margin-top: 1px; color: #d97706; }

.am-sub-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--am-border);
}
.am-sub-actions-left { display: flex; flex-wrap: wrap; gap: 8px; }
.am-sub-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c !important;
  text-decoration: none;
  border: 1px solid transparent;
  margin-left: auto;
}
.am-sub-cancel:hover { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.25); }

[data-theme="dark"] .am-sub-status.is-active { color: #4ade80; }
[data-theme="dark"] .am-sub-status.is-cancelled { color: #fbbf24; }
[data-theme="dark"] .am-sub-status.is-failed, [data-theme="dark"] .am-sub-cancel { color: #f87171 !important; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-sub-status.is-active { color: #4ade80; }
  [data-theme="system"] .am-sub-status.is-cancelled { color: #fbbf24; }
  [data-theme="system"] .am-sub-status.is-failed, [data-theme="system"] .am-sub-cancel { color: #f87171 !important; }
}

@media (max-width: 560px) {
  .am-sub-card { padding: 16px 16px 16px 18px; }
  .am-sub-price strong { font-size: 20px; }
  .am-sub-facts { grid-template-columns: 1fr 1fr; }
  .am-sub-actions { flex-direction: column; align-items: stretch; }
  .am-sub-actions .btn, .am-sub-cancel { justify-content: center; }
  .am-sub-cancel { margin-left: 0; }
}

/* Billing subscription cards: compact (one-line details, no boxes) */
.am-sub-list { gap: 10px; }
.am-sub-card { gap: 6px; padding: 14px 18px 14px 20px; border-radius: 12px; }
.am-sub-head { align-items: center; }
.am-sub-title { font-size: 15.5px; }
.am-sub-status { padding: 3px 9px; font-size: 11.5px; }
.am-sub-price { margin-top: 0; font-size: 13px; }
.am-sub-price strong { font-size: 18px; }
.am-sub-kind { padding: 1px 7px; font-size: 11px; }
.am-sub-first { margin-top: -2px; }
.am-sub-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.am-sub-facts > div { display: flex; align-items: baseline; gap: 5px; }
.am-sub-facts dt {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.am-sub-facts dt::after { content: ":"; }
.am-sub-facts dd { font-size: 13px; }
.am-sub-note {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: 12.5px;
  color: #b45309;
}
.am-sub-note svg { width: 14px !important; height: 14px !important; margin-top: 2px; }
.am-sub-actions { padding-top: 2px; border-top: 0; }
.am-sub-cancel { padding: 4px 10px; font-size: 12.5px; }
[data-theme="dark"] .am-sub-note { color: #fbbf24; }
@media (prefers-color-scheme: dark) { [data-theme="system"] .am-sub-note { color: #fbbf24; } }
@media (max-width: 560px) {
  .am-sub-card { padding: 12px 14px 12px 16px; }
  .am-sub-facts { gap: 2px 14px; }
  .am-sub-actions { flex-direction: row; align-items: center; }
  .am-sub-cancel { margin-left: auto; }
}

/* Billing: Cancel Subscription as a soft red button */
.am-sub-actions .am-sub-cancel {
  padding: 6px 14px;
  border-radius: 8px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c !important;
  transition: background-color .15s ease, border-color .15s ease;
}
.am-sub-actions .am-sub-cancel:hover {
  background: #fecaca;
  border-color: #f87171;
}
[data-theme="dark"] .am-sub-actions .am-sub-cancel { background: rgba(239, 68, 68, 0.14); border-color: rgba(248, 113, 113, 0.4); color: #fca5a5 !important; }
[data-theme="dark"] .am-sub-actions .am-sub-cancel:hover { background: rgba(239, 68, 68, 0.24); }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-sub-actions .am-sub-cancel { background: rgba(239, 68, 68, 0.14); border-color: rgba(248, 113, 113, 0.4); color: #fca5a5 !important; }
  [data-theme="system"] .am-sub-actions .am-sub-cancel:hover { background: rgba(239, 68, 68, 0.24); }
}

/* ==========================================================================
   UPLOADED LOGO (Setup -> Themes -> AMModern -> Branding)
   Replaces the icon + site name in the sidebar, the phone/tablet top bar and the public header.
   With a separate dark-mode logo, each shows in its own mode.
   ========================================================================== */
.am-brand.has-logo { gap: 0; min-width: 0; }
.am-brand-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  object-position: left center;
}
.am-brand-logo-dark { display: none; }
[data-theme="dark"] .am-brand-logo-light { display: none; }
[data-theme="dark"] .am-brand-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-brand-logo-light { display: none; }
  [data-theme="system"] .am-brand-logo-dark { display: block; }
}
@media (max-width: 640px) {
  .am-header-brand .am-brand-logo { height: 28px; max-width: 150px; }
}

/* ==========================================================================
   ACTIVE MENU ITEMS IN DARK MODE
   The active sidebar item, submenu item and user-menu item use the primary colour as text,
   which is too dark to read on the dark sidebar. In dark mode they use a lighter tint of the
   primary colour (follows the colour set in the theme settings) and a slightly stronger background.
   ========================================================================== */
[data-theme="dark"] {
  --am-primary-on-dark: #a5b4fc;
  --am-primary-on-dark: color-mix(in srgb, var(--am-primary) 45%, #ffffff);
  --am-primary-active-bg: rgba(99, 102, 241, 0.2);
  --am-primary-active-bg: color-mix(in srgb, var(--am-primary) 24%, transparent);
}
[data-theme="dark"] .am-nav-item.active .am-nav-link,
[data-theme="dark"] .am-nav-item.active .am-nav-icon,
[data-theme="dark"] .am-nav-group.active > .am-nav-group-btn .am-nav-icon,
[data-theme="dark"] .am-subnav-link.active,
[data-theme="dark"] .am-subnav-link.active .am-subnav-icon,
[data-theme="dark"] .am-user-menu-item.active,
[data-theme="dark"] .am-user-menu-item.active .am-user-menu-icon {
  color: var(--am-primary-on-dark);
}
[data-theme="dark"] .am-nav-item.active .am-nav-link,
[data-theme="dark"] .am-subnav-link.active,
[data-theme="dark"] .am-user-menu-item.active {
  background: var(--am-primary-active-bg);
}
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --am-primary-on-dark: #a5b4fc;
    --am-primary-on-dark: color-mix(in srgb, var(--am-primary) 45%, #ffffff);
    --am-primary-active-bg: rgba(99, 102, 241, 0.2);
    --am-primary-active-bg: color-mix(in srgb, var(--am-primary) 24%, transparent);
  }
  [data-theme="system"] .am-nav-item.active .am-nav-link,
  [data-theme="system"] .am-nav-item.active .am-nav-icon,
  [data-theme="system"] .am-nav-group.active > .am-nav-group-btn .am-nav-icon,
  [data-theme="system"] .am-subnav-link.active,
  [data-theme="system"] .am-subnav-link.active .am-subnav-icon,
  [data-theme="system"] .am-user-menu-item.active,
  [data-theme="system"] .am-user-menu-item.active .am-user-menu-icon {
    color: var(--am-primary-on-dark);
  }
  [data-theme="system"] .am-nav-item.active .am-nav-link,
  [data-theme="system"] .am-subnav-link.active,
  [data-theme="system"] .am-user-menu-item.active {
    background: var(--am-primary-active-bg);
  }
}

/* ==========================================================================
   NOTIFICATIONS: WHATSAPP NEEDS A VERIFIED NUMBER (WhatsApp Verification on)
   ========================================================================== */
.am-switch.is-locked { opacity: .45; cursor: not-allowed; }
.am-switch.is-locked .am-switch-slider { cursor: not-allowed; }
/* Email Notifications: always on, cannot be switched off */
.am-switch.is-forced { cursor: not-allowed; }
.am-always-on { background: #ede9fe; color: #5b21b6; font-size: 10px; font-weight: 700; }
[data-theme="dark"] .am-always-on { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
@media (prefers-color-scheme: dark) { [data-theme="system"] .am-always-on { background: rgba(139, 92, 246, .18); color: #c4b5fd; } }
.am-switch.is-forced .am-switch-slider { cursor: not-allowed; }
.am-wa-verify-first {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
}
.am-wa-verify-icon { width: 20px; height: 20px; color: #d97706; flex: 0 0 auto; }
.am-wa-verify-text { flex: 1 1 220px; min-width: 0; font-size: 12.5px; line-height: 1.45; color: #92400e; }
.am-wa-verify-text strong { display: block; font-size: 13.5px; font-weight: 700; color: #78350f; }
.am-wa-verify-first .am-wa-verify-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 13px;
  text-decoration: none;
}
.am-wa-verified-field { position: relative; max-width: 440px; }
.am-wa-verified-field input {
  width: 100%;
  height: 40px;
  padding: 8px 100px 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--am-border) !important;
  background: var(--am-surface-subtle) !important;
  color: var(--am-text) !important;
  font-size: 13.5px;
  box-sizing: border-box;
  cursor: default;
  caret-color: transparent;
  outline: none !important;
  box-shadow: none !important;
}
.am-wa-verified-badge {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 11.5px;
  font-weight: 700;
}
.am-wa-verified-badge svg { width: 13px; height: 13px; }
[data-theme="dark"] .am-wa-verify-first { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); }
[data-theme="dark"] .am-wa-verify-text { color: #fcd34d; }
[data-theme="dark"] .am-wa-verify-text strong { color: #fde68a; }
[data-theme="dark"] .am-wa-verified-badge { background: rgba(34, 197, 94, .15); color: #4ade80; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-wa-verify-first { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); }
  [data-theme="system"] .am-wa-verify-text { color: #fcd34d; }
  [data-theme="system"] .am-wa-verify-text strong { color: #fde68a; }
  [data-theme="system"] .am-wa-verified-badge { background: rgba(34, 197, 94, .15); color: #4ade80; }
}
@media (max-width: 480px) {
  .am-wa-verify-first .am-wa-verify-btn { width: 100%; justify-content: center; }
}

/* ==========================================================================
   NOTIFICATIONS: COMPACT CHANNEL CARDS (Email, Telegram, WhatsApp)
   icon | title + tag, one-line description, one-line target (address, chat, number) | switch
   ========================================================================== */
.am-channel-card.am-ch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--am-border);
  border-radius: 12px;
  background: var(--am-surface);
}
.am-ch-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.am-ch-icon svg { width: 18px; height: 18px; }
.am-ch-icon-email { background: #eff6ff; color: #2563eb; }
.am-ch-icon-tg { background: #e0f2fe; color: #0284c7; }
.am-ch-icon-wa { background: #dcfce7; color: #16a34a; }
.am-ch-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.am-ch-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.am-ch-head strong { font-size: 15px; color: var(--am-text); }
.am-ch-badge-tg { background: #e0f2fe; color: #0369a1; font-size: 10px; font-weight: 700; }
.am-ch-desc { font-size: 12.5px; line-height: 1.45; color: var(--am-text-muted); }
.am-ch-target {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  min-width: 0;
  font-size: 13px;
  transition: opacity .15s ease;
}
.am-ch-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--am-surface-subtle);
  border: 1px solid var(--am-border);
  color: var(--am-text);
  font-weight: 600;
  font-size: 12.5px;
}
.am-ch-chip svg { width: 14px; height: 14px; flex: 0 0 auto; }
.am-ch-chip-ok svg { color: #16a34a; }
.am-ch-chip-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.am-ch-chip-warn svg { color: #d97706; }
.am-ch-link,
.am-ch-link-btn {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--am-primary-on-dark, var(--am-primary)) !important;
}
.am-ch-link:hover { text-decoration: underline; }
button.am-ch-link-btn {
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  height: auto !important;
  width: auto !important;
  box-shadow: none !important;
  cursor: pointer;
}
.am-ch-target .am-ch-action {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--am-primary);
  color: #fff !important;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
}
.am-ch-target .am-ch-action:hover { background: var(--am-primary-hover, var(--am-primary)); }
.am-ch-note { font-size: 12.5px; color: var(--am-text-muted); }
.am-ch-input.am-input-control {
  width: 100%;
  max-width: 260px;
  height: 34px !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
}
.am-ch > .am-switch { flex: 0 0 auto; margin-top: 4px; }
[data-theme="dark"] .am-ch-icon-email { background: rgba(37, 99, 235, .15); color: #93c5fd; }
[data-theme="dark"] .am-ch-icon-tg { background: rgba(14, 165, 233, .15); color: #7dd3fc; }
[data-theme="dark"] .am-ch-icon-wa { background: rgba(34, 197, 94, .15); color: #4ade80; }
[data-theme="dark"] .am-ch-badge-tg { background: rgba(14, 165, 233, .15); color: #7dd3fc; }
[data-theme="dark"] .am-ch-chip-ok svg { color: #4ade80; }
[data-theme="dark"] .am-ch-chip-warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); color: #fcd34d; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-ch-icon-email { background: rgba(37, 99, 235, .15); color: #93c5fd; }
  [data-theme="system"] .am-ch-icon-tg { background: rgba(14, 165, 233, .15); color: #7dd3fc; }
  [data-theme="system"] .am-ch-icon-wa { background: rgba(34, 197, 94, .15); color: #4ade80; }
  [data-theme="system"] .am-ch-badge-tg { background: rgba(14, 165, 233, .15); color: #7dd3fc; }
  [data-theme="system"] .am-ch-chip-ok svg { color: #4ade80; }
  [data-theme="system"] .am-ch-chip-warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); color: #fcd34d; }
}

/* ==========================================================================
   AVATAR BLUE RING (header user button, sidebar user card, both user menus)
   a thin gap in the surface colour, then a blue ring
   ========================================================================== */
.am-sidebar-avatar,
.am-user-menu-avatar {
  box-shadow: 0 0 0 2px var(--am-surface, #fff), 0 0 0 4px #3b82f6;
}
#am-header-user-trigger:hover .am-sidebar-avatar,
#am-header-user-trigger:focus-visible .am-sidebar-avatar {
  box-shadow: 0 0 0 2px var(--am-surface, #fff), 0 0 0 4px #2563eb;
}
/* verified tick sits on the ring (bottom-right, 45deg), in the ring's blue */
.am-sidebar-avatar .am-avatar-verified-badge,
.am-user-menu-avatar .am-avatar-verified-badge {
  width: 16px;
  height: 16px;
  right: -5px;
  bottom: -5px;
  filter: none;
}
.am-sidebar-avatar .am-avatar-verified-badge svg,
.am-user-menu-avatar .am-avatar-verified-badge svg {
  width: 16px;
  height: 16px;
  display: block;
}
.am-sidebar-avatar .am-avatar-verified-badge circle,
.am-user-menu-avatar .am-avatar-verified-badge circle {
  fill: #3b82f6;
  stroke: var(--am-surface, #fff);
  stroke-width: 2.5px;
}

/* ==========================================================================
   DASHBOARD ALL TOOLS: COMPACT TILES
   more tools per row: full-width logo box on top, then name + price, then the buttons
   (overrides the inline layout in member/main.phtml; nothing is hidden)
   ========================================================================== */
#dash-all-tools .am-all-tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)) !important;
  gap: 12px !important;
}
#dash-all-tools .am-all-tools-card {
  padding: 12px !important;
  gap: 10px !important;
  border-radius: 12px !important;
}
#dash-all-tools .am-all-tools-head {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 22px !important;
}
#dash-all-tools .am-all-tools-logo {
  flex: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 48px !important;
}
#dash-all-tools .am-all-tools-logo img {
  padding: 5px 8px !important;
}
#dash-all-tools .am-all-tools-head > div:last-child {
  min-width: 0;
}
#dash-all-tools .am-all-tools-head h4 {
  font-size: 14px !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  margin: 0 0 2px !important;
}
#dash-all-tools .am-all-tools-price {
  font-size: 12.5px !important;
  white-space: normal !important;
}
#dash-all-tools .am-all-tools-card > div:last-child {
  margin-top: 0 !important;
  gap: 6px !important;
}
#dash-all-tools .am-all-tools-card > div:last-child > .btn,
#dash-all-tools .am-all-tools-card > div:last-child > .btn-tool-access {
  flex: 1 1 auto;
  justify-content: center;
  margin-left: 0 !important;
  padding: 6px 10px !important;
  font-size: 12.5px !important;
  min-width: 0;
}
@media (max-width: 600px) {
  #dash-all-tools .am-all-tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
    gap: 10px !important;
  }
  #dash-all-tools .am-all-tools-card {
    padding: 10px !important;
  }
  #dash-all-tools .am-all-tools-logo {
    height: 44px !important;
  }
  #dash-all-tools .am-all-tools-card > div:last-child > .btn,
  #dash-all-tools .am-all-tools-card > div:last-child > .btn-tool-access {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }
}
/* tool name hidden on the tiles (the logo shows it) but kept in the page: search and screen readers still use it */
#dash-all-tools .am-all-tools-head h4 {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ==========================================================================
   THEME SWITCHER: ONE BUTTON
   only the button for the other mode is shown (moon in light mode, sun in dark mode);
   follows data-theme on <html>, which is set before the page draws
   ========================================================================== */
.am-theme-switcher {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border-radius: 8px;
  border: 1px solid var(--am-border);
  background: var(--am-surface);
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: var(--am-transition);
}
.am-theme-switcher:hover {
  border-color: var(--am-text-muted);
}
.am-theme-switcher .am-theme-btn {
  width: 100%;
  height: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--am-text-muted) !important;
}
.am-theme-switcher:hover .am-theme-btn {
  color: var(--am-text) !important;
}
.am-theme-switcher .am-theme-btn svg {
  width: 16px !important;
  height: 16px !important;
}
:root:not([data-theme="dark"]) .am-theme-switcher .am-theme-btn[data-mode="light"],
:root[data-theme="dark"] .am-theme-switcher .am-theme-btn[data-mode="dark"] {
  display: none !important;
}
@media (max-width: 860px) {
  .am-theme-switcher {
    width: 32px;
    height: 32px;
  }
}


/* ---------- IMAGES: NOT SELECTABLE / DRAGGABLE ----------
   Dragging the mouse over the page highlights text only; logos, banners and icons stay unselected
   and can't be dragged off as files. Links around images still work. */
body img,
body svg {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
body img::selection { background: transparent; }

/* ---------- /forgot: the page heading already says it; hide the form's own legend and notice ---------- */
.am-auth-card-form .am-sendpass-form legend,
.am-auth-card-form .am-sendpass-form .am-row-sendpass-notice { display: none !important; }

/* login / forgot-password notices (e.g. "a reset link has been sent"): readable in light and dark mode */
.am-auth-card-form .am-info {
  margin: 0 0 14px; padding: 11px 14px; border-radius: 10px;
  background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .35);
  color: var(--am-text) !important; font-size: 13.5px; line-height: 1.5;
}

/* ---------- signup: form errors at the top (e-mail / phone already used, ...) ---------- */
.am-page-signup .am-form > .am-errors {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 18px; padding: 12px 14px; border-radius: 12px;
  background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .35);
  color: #b91c1c; font-size: 13.5px; font-weight: 600; line-height: 1.55;
  white-space: pre-line; /* one message per line */
}
.am-page-signup .am-form > .am-errors::before {
  content: "!"; flex: 0 0 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ef4444; color: #fff; font-size: 12px; font-weight: 800; line-height: 1; margin-top: 1px;
}
.am-page-signup .am-form > .am-errors ul { margin: 0; padding: 0; list-style: none; }
[data-theme="dark"] .am-page-signup .am-form > .am-errors { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .am-page-signup .am-form > .am-errors { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }
}
/* the e-mail field keeps its red border only for other problems; "already used" is shown at the top */
.am-page-signup .am-element.am-dup-hidden input { border-color: rgba(239, 68, 68, .55) !important; }
.am-page-signup .am-form > .am-errors ul,
.am-page-signup .am-form > .am-errors li {
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  margin: 0 !important; padding: 0 !important; color: inherit !important; font: inherit !important;
}
.am-page-signup span.am-error.am-dup-msg { display: none !important; }
.am-page-signup input.am-dup-phone { border-color: rgba(239, 68, 68, .55) !important; }

/* ==========================================================================
   LOGO SIZE (SeoToolAdda logo, trimmed to the artwork: about 2.66 : 1)
   phone 38px, tablet 42px, desktop 46px, large screens 50px tall
   ========================================================================== */
.am-brand-logo { height: 46px; max-width: 200px; }
@media (max-width: 1023px) {
  .am-brand-logo { height: 42px; max-width: 180px; }
}
@media (max-width: 640px) {
  .am-brand-logo,
  .am-header-brand .am-brand-logo { height: 38px; max-width: 160px; }
}
@media (min-width: 1600px) {
  .am-brand-logo { height: 50px; max-width: 220px; }
}
