/* ============================================================================
   2BASE.RU — Custom Styles (supplements Tailwind CSS)
   Only styles that Tailwind utility classes cannot provide.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   Design tokens — single source of truth for colors/radii/shadows/transitions.
   The same values are mirrored in `tailwind.config.js` (primary/dark scales),
   so a re-skin only requires editing two files instead of hunting hex codes
   across 30+ templates.
   ---------------------------------------------------------------------------- */
:root {
  /* Brand: emerald scale (primary) */
  --brand-50:  #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-300: #6ee7b7;
  --brand-400: #34d399;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-800: #065f46;
  --brand-900: #064e3b;

  /* Neutrals: slate scale (dark) */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic surface tokens */
  --color-surface:        #ffffff;
  --color-surface-soft:   var(--gray-50);
  --color-surface-strong: var(--gray-900);
  --color-border:         #e5edf5;
  --color-border-soft:    #dbe4ee;

  /* Text tokens (paired with WCAG AA contrast on white) */
  --color-text-primary:   var(--gray-800);   /* 13.4:1 on white */
  --color-text-secondary: var(--gray-600);   /* 7.5:1 — body */
  --color-text-muted:     var(--gray-500);   /* 4.8:1 — minimum AA */
  --color-text-faint:     var(--gray-400);   /* decorative only, aria-hidden */

  /* Status */
  --color-danger:  #dc2626;
  --color-warning: #d97706;
  --color-success: var(--brand-600);

  /* Radii — only four steps, used everywhere */
  --radius-xs: 0.5rem;     /* 8px — chips, badges, small buttons */
  --radius-sm: 0.625rem;   /* 10px — small chips, tags */
  --radius-md: 0.95rem;    /* 15px — buttons, inputs */
  --radius-lg: 1.25rem;    /* 20px — cards, large surfaces */

  /* Interactive border tokens (hover states) */
  --color-border-hover:      #c7d2de;   /* hover border for forms/buttons */
  --color-border-link-hover: #dbe4ee;   /* hover for link cards */

  /* Shadows — premium UI uses emerald-tinted ambient light on public surfaces;
     admin keeps neutral slate ambient to avoid brand-bleed into dense dashboards. */
  --shadow-card:           0 10px 30px rgba(16, 185, 129, 0.06);
  --shadow-card-hover:     0 14px 30px rgba(16, 185, 129, 0.10);
  --shadow-card-tinted:    0 10px 30px rgba(16, 185, 129, 0.08);
  --shadow-button:         0 8px 20px rgba(16, 185, 129, 0.20);
  --shadow-button-tinted:  0 8px 20px rgba(16, 185, 129, 0.20);
  --shadow-elevated:       0 18px 40px rgba(15, 23, 42, 0.08);

  /* Motion */
  --transition-fast: 160ms ease;
  --transition-mid:  220ms ease;

  /* Focus ring (keyboard) */
  --ring-focus: 0 0 0 4px rgba(16, 185, 129, 0.18);
  --ring-focus-neutral: 0 0 0 4px rgba(148, 163, 184, 0.18);
  --ring-focus-danger:  0 0 0 4px rgba(220, 38, 38, 0.18);
}

/* ----------------------------------------------------------------------------
   WCAG 2.3.3 (Animation from Interactions) — respect user's OS-level setting
   to reduce motion. Collapses animations and transitions to ~0 for users who
   are sensitive to motion (vestibular disorders, migraines, etc.). Applied
   globally via *, *::before, *::after so every transition/animation defined
   later in this file or in Tailwind utilities is automatically covered.
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------------------------
   Display-heading typography — letter-spacing system for large headings.
   Applied via templates: `.app-h-display` for text-4xl/5xl/6xl (>= 32px),
   `.app-h-large` for text-2xl/3xl (24-30px). Tightens optical tracking on
   large type to match premium editorial look.
   ---------------------------------------------------------------------------- */
.app-h-display { letter-spacing: -0.025em; line-height: 1.1; }
.app-h-large   { letter-spacing: -0.015em; line-height: 1.2; }

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Contact blur effect on company pages */
.blur-contact {
  filter: blur(3px);
  user-select: none;
  pointer-events: none;
}

/* Alpine.js cloak: hide elements until Alpine initializes */
[x-cloak] {
  display: none !important;
}

/* Smooth collapse transition for Alpine x-collapse */
[x-collapse] {
  overflow: hidden;
}

/* Focus visible ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* Form system */
.app-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: var(--gray-700);
}

.app-form-help {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-text-muted);
}

.app-form-field,
.app-form-textarea {
  width: 100%;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #fcfefe 100%);
  color: var(--gray-900);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.app-form-field {
  min-height: 3rem;
  padding: 0.75rem 1rem;
}

.app-form-textarea {
  min-height: 7rem;
  padding: 0.75rem 1rem;
  resize: vertical;
}

.app-form-field--sm {
  min-height: 2.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
}

.app-form-field:hover,
.app-form-textarea:hover {
  border-color: var(--color-border-hover);
}

.app-form-field:focus,
.app-form-textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--ring-focus);
}

.app-form-field:disabled,
.app-form-textarea:disabled {
  background: var(--color-surface-soft);
  color: var(--color-text-faint);
  cursor: not-allowed;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.app-btn:hover {
  transform: translateY(-1px);
}

.app-btn:focus {
  outline: none;
}

.app-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.app-btn--sm {
  min-height: 2.375rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

/* Touch-device override: bump compact form field + button heights to the
   WCAG 2.5.5 / Apple HIG / Material 44px minimum. Coarse-pointer targets
   touch screens (phones, tablets) without affecting desktop density. */
@media (hover: none) and (pointer: coarse) {
  .app-form-field--sm,
  .app-btn--sm,
  .app-native-select--sm {
    min-height: 2.75rem;
  }

  /* Footer link list — expand each row to a 44px tap area on touch. */
  footer ul li a,
  footer ul li {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }
}

/* Primary button uses brand-700 (#047857) for the resting state because white
   text on brand-500 (#10b981) is only 2.54:1 — far below WCAG AA. brand-700
   gives 5.48:1, which clears AA for body text and matches the visual weight
   the brand still expects (it is darker but the eye reads it as confident). */
.app-btn--primary {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
  box-shadow: var(--shadow-button);
}

.app-btn--primary:hover {
  background: var(--brand-800);
  border-color: var(--brand-800);
}

.app-btn--primary:focus {
  box-shadow: var(--ring-focus), var(--shadow-button);
}

.app-btn--secondary {
  background: var(--color-surface);
  border-color: var(--color-border-soft);
  color: var(--color-text-secondary);
}

.app-btn--secondary:hover {
  border-color: var(--color-border-hover);
  background: var(--color-surface-soft);
  color: var(--color-text-primary);
}

.app-btn--secondary:focus {
  box-shadow: var(--ring-focus-neutral);
}

.app-btn--ghost {
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand-700);
}

.app-btn--ghost:hover {
  background: #dff7ee;
  border-color: #baf3da;
}

.app-btn--ghost:focus {
  box-shadow: var(--ring-focus);
}

.app-btn--danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

.app-btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.app-btn--danger:focus {
  box-shadow: var(--ring-focus-danger);
}

.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-border-soft);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  line-height: 1rem;
}

.app-chip--active {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

/* Public surfaces and content cards */
.app-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.app-card--padded {
  padding: 1.5rem;
}

.app-card--soft {
  background: var(--color-surface-soft);
  border-color: var(--gray-200);
  box-shadow: none;
}

.app-card--tint {
  background: linear-gradient(180deg, #f0fdf4 0%, var(--brand-50) 100%);
  border-color: #bbf7d0;
  box-shadow: none;
}

.app-stat-tile {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 1.25rem;
}

.app-stat-tile__label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-text-muted);
}

.app-stat-tile__value {
  margin-top: 0.35rem;
  color: var(--gray-900);
  font-weight: 700;
}

.app-link-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 1.15rem 1.2rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.app-link-card:hover {
  border-color: #bfdbfe;
  background: #fbfdff;
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

/* eyebrow is decorative but Lighthouse flags it as text — bump to gray-600
   (7.5:1 on white) so it always passes WCAG AA, including on tinted card backgrounds. */
.app-link-card__eyebrow {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.app-link-card__title {
  margin-top: 0.35rem;
  color: var(--gray-900);
  font-weight: 600;
}

.app-link-card__text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.35rem;
  color: var(--color-text-secondary);
}

.app-note {
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  padding: 1rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.4rem;
  color: var(--color-text-secondary);
}

.app-note--tint {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* Status note variants — referenced across 10+ templates (company unlock
   notice/error, account_wallet, order_status, wallet_topup_status, admin
   forms) but were never defined, so the status colour silently fell back to
   the neutral note surface. Palette mirrors .app-status-badge--* so a note and
   a badge for the same state read identically. */
.app-note--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.app-note--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.app-note--warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.app-cta-band {
  border: 1px solid #bbf7d0;
  border-radius: 1.5rem;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  padding: 2rem;
}

/* Admin surfaces and density system */
.app-panel {
  border: 1px solid #e5edf5;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.app-panel--padded {
    padding: 1.5rem;
}

.customer-shell {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .customer-shell {
        grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
        align-items: start;
    }
}

.customer-nav {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .customer-nav {
        position: sticky;
        top: 6.5rem;
    }
}

.customer-nav__card {
    border: 1px solid #e5edf5;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 1rem;
}

.customer-nav__eyebrow {
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.customer-nav__email {
    margin-top: 0.35rem;
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.customer-nav__meta {
    margin-top: 0.6rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #475569;
}

.customer-nav__links {
    display: grid;
    gap: 0.35rem;
}

.customer-nav__link,
.customer-nav__button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    font-weight: 500;
    color: #334155;
    background: transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.customer-nav__link:hover,
.customer-nav__button:hover {
    background: #f8fafc;
}

.customer-nav__link--active {
    background: #ecfdf5;
    color: #047857;
}

.customer-nav__button {
    border: 0;
    text-align: left;
    cursor: pointer;
}

.customer-nav__button--danger {
    color: #b91c1c;
}

.customer-nav__button--danger:hover {
    background: #fef2f2;
}

.app-admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  width: fit-content;
  margin-bottom: 2rem;
  padding: 0.25rem;
  border: 1px solid #e5edf5;
  border-radius: 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.app-admin-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.8rem;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.app-admin-nav__link:hover {
  color: #0f172a;
}

.app-admin-nav__link.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Single canonical table component (T12 unification, 2026-07-03) — used on both
   admin panels and public pages. Formerly split into .app-table (admin) and the
   near-duplicate .app-data-table (public); merged onto this definition, public
   templates renamed app-data-table -> app-table. Wrap in .app-table-wrap
   (admin, bleeds to a padded panel's edge) or a plain overflow-x-auto div
   (public) so a wide table scrolls instead of blowing out the layout. */
.app-table-wrap {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.app-table thead tr {
  background: #f8fafc;
}

.app-table th {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5edf5;
  text-align: left;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #eef2f7;
  color: #334155;
  vertical-align: middle;
}

.app-table tbody tr:last-child td {
  border-bottom: 0;
}

.app-table tbody tr:hover {
  background: #fbfdff;
}

.app-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  white-space: nowrap;
}

.app-status-badge--success {
  background: #dcfce7;
  color: #166534;
}

.app-status-badge--warning {
  background: #fef3c7;
  color: #92400e;
}

.app-status-badge--info {
  background: #dbeafe;
  color: #1d4ed8;
}

.app-status-badge--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.app-status-badge--neutral {
  background: #f1f5f9;
  color: #475569;
}

.app-status-badge--accent {
  background: #f3e8ff;
  color: #7e22ce;
}

.app-dot-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.app-dot-status__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.app-dot-status--success {
  color: #15803d;
}

.app-dot-status--success .app-dot-status__dot {
  background: #22c55e;
}

.app-dot-status--danger {
  color: #dc2626;
}

.app-dot-status--danger .app-dot-status__dot {
  background: #ef4444;
}

.app-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5edf5;
  font-size: 0.875rem;
}

.app-pagination__meta {
  color: #64748b;
}

.app-pagination__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-border-link-hover);
  border-radius: 0.8rem;
  background: #fff;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.app-page-link:hover {
  border-color: var(--color-border-hover);
  background: #f8fafc;
  color: #0f172a;
}

.app-page-link.is-current {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.app-stat-card {
  border: 1px solid #e5edf5;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  padding: 1.25rem;
}

.app-stat-card__row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.app-stat-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.app-stat-card__label {
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.app-stat-card__value {
  margin-top: 0.15rem;
  font-size: 1.75rem;
  line-height: 2rem;
  font-weight: 700;
  color: #0f172a;
}

.app-quick-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e5edf5;
  border-radius: 0.95rem;
  background: #fff;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.app-quick-link:hover {
  border-color: var(--color-border-hover);
  background: #fbfdff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.app-quick-link__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* Reusable select / combobox */
.app-select__native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.app-select {
  position: relative;
}

.app-select__trigger {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--color-border-link-hover);
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fcfefe 100%);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.app-select__trigger:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.app-select.is-open .app-select__trigger {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10), 0 12px 32px rgba(15, 23, 42, 0.08);
}

.app-select__value-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.app-select__label {
  font-size: 1rem;
  line-height: 1.375rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-select__meta {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #94a3b8;
}

.app-select__chevron {
  flex-shrink: 0;
  color: #64748b;
  transition: transform 160ms ease;
}

.app-select__chevron svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.app-select.is-open .app-select__chevron {
  transform: rotate(180deg);
}

.app-select__panel {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  z-index: 40;
  border: 1px solid var(--color-border-link-hover);
  border-radius: 1.125rem;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.app-select__search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(8px);
}

.app-select__search-input {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #d7e1ea;
  border-radius: 0.875rem;
  padding: 0 0.875rem;
  background: #fff;
  color: #0f172a;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.app-select__search-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10);
  outline: none;
}

.app-select__list {
  max-height: 18rem;
  overflow: auto;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.app-select__list::-webkit-scrollbar {
  width: 10px;
}

.app-select__list::-webkit-scrollbar-track {
  background: transparent;
}

.app-select__list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #fff;
}

.app-select__option {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 0.875rem;
  padding: 0.75rem 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  color: #0f172a;
  transition: background-color 140ms ease, color 140ms ease;
}

.app-select__option:hover,
.app-select__option.is-highlighted {
  background: #f8fafc;
}

.app-select__option.is-selected {
  background: linear-gradient(180deg, #ecfdf5 0%, #e7fbf4 100%);
  color: #047857;
}

.app-select__option-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.app-select__option-label {
  font-size: 0.975rem;
  line-height: 1.35rem;
}

.app-select__option-meta {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #94a3b8;
}

.app-select__empty {
  padding: 0.875rem 1rem 1rem;
  color: #64748b;
  font-size: 0.875rem;
}

.app-select__check {
  flex-shrink: 0;
  color: #059669;
  font-size: 0.875rem;
  font-weight: 700;
}

/* Lightweight styled native selects for dense admin UI */
.app-native-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 2.5rem 0.625rem 0.875rem;
  border: 1px solid var(--color-border-link-hover);
  border-radius: 0.875rem;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.app-native-select:hover {
  border-color: var(--color-border-hover);
}

.app-native-select:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10);
}

.app-native-select--sm {
  min-height: 2.25rem;
  padding: 0.45rem 2rem 0.45rem 0.7rem;
  border-radius: 0.75rem;
  background-position: right 0.6rem center;
  background-size: 0.95rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

/* Choice pills and checkbox controls */
.app-choice-pill {
  min-height: 2.875rem;
  padding: 0.625rem 0.9rem;
  border: 1px solid var(--color-border-link-hover);
  border-radius: 0.9rem;
  background: #fff;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.app-choice-pill:hover {
  border-color: var(--color-border-hover);
}

.app-choice-pill.is-selected {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08);
}

.app-choice-pill:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10);
}

.app-check-card {
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border-link-hover);
  border-radius: 0.95rem;
  background: #fff;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

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

.app-check-card.is-selected {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08);
}

.app-check-card:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10);
}

.app-check-card__label {
  font-size: 0.95rem;
  line-height: 1.35rem;
}

.app-check-card__control,
.app-check-inline__control {
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.app-check-card__control::after,
.app-check-inline__control::after {
  content: "";
  width: 0.35rem;
  height: 0.6rem;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(45deg) scale(0.8);
  transition: border-color 160ms ease;
}

.app-check-card.is-selected .app-check-card__control {
  border-color: #10b981;
  background: #10b981;
}

.app-check-card.is-selected .app-check-card__control::after {
  border-color: #fff;
}

.app-check-inline {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: #475569;
  cursor: pointer;
}

.app-check-inline__input,
.app-choice-pill__input,
.app-check-card__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.app-check-inline__label {
  font-size: 0.875rem;
  line-height: 1.35rem;
}

.app-check-inline:focus-within .app-check-inline__control {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10);
}

.app-check-inline__input:checked + .app-check-inline__control {
  border-color: #10b981;
  background: #10b981;
}

.app-check-inline__input:checked + .app-check-inline__control::after {
  border-color: #fff;
}

/* Ready-made base cards on /bases listing — Avito-style.
   No outer border, no shadow, just rounded cover image on top and plain
   text under it. Density of the listing creates the visual rhythm. */
.app-base-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  text-decoration: none;
  position: relative;
}
.app-base-card:hover .app-base-card__cover {
  transform: scale(1.01);
}
.app-base-card__cover {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--color-surface-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 200ms ease;
}
.app-base-card__cover--fallback {
  background-image: linear-gradient(135deg, #1f2937 0%, #0f172a 100%);
}
.app-base-card__body {
  padding: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.app-base-card__title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--brand-700);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Count is the hero — what visitors actually shop on. Price range sits
   small underneath as a "from-to per contact" hint, not the full base
   sum. */
.app-base-card__count {
  font-size: 1.05rem;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.app-base-card__count strong {
  color: var(--gray-900);
  font-weight: 700;
}
.app-base-card__count span {
  color: var(--color-text-muted);
}
.app-base-card__price {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.app-base-card__price strong {
  font-weight: 600;
}
.app-base-card__cov {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.7rem;
  list-style: none;
  padding: 0;
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.app-base-card__cov li {
  display: inline-flex;
  gap: 0.25rem;
}
.app-base-card__cov strong {
  color: var(--gray-900);
  font-weight: 600;
}

/* Native file input — make the chooser button match our brand button style. */
input[type="file"]::file-selector-button {
  cursor: pointer;
}

/* Print styles */
@media print {
  nav, footer, .no-print { display: none !important; }
  body { background: white; color: black; }
}
