button:not(:disabled),
[role="button"]:not(:disabled) {
  cursor: pointer;
}

*,
*::before,
*::after {
  border-color: var(--color-border);
}

#message-modal a {
  text-decoration: underline;
}

.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-card {
  background: rgba(44, 44, 46, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.input-field {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  transition: all 0.2s ease;
  color: var(--color-heading);
}

.input-field:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.dark .input-field {
  background: rgba(44, 44, 46, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.dark .input-field:focus {
  border-color: #0a84ff;
}

.dark .input-field::placeholder {
  color: #8e8e93;
}

.btn-primary {
  background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 122, 255, 0.2);
  color: #007aff;
}

.btn-secondary:hover {
  background: rgba(0, 122, 255, 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  transition: all 0.2s ease;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.dark .btn-secondary {
  background: rgba(44, 44, 46, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.dark .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.price-history-table-scroll {
  max-height: min(55vh, calc(90vh - 260px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.price-history-table-min {
  min-width: 900px;
}

.nav-item {
  position: relative;
  transition: all 0.2s ease;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #007aff;
  border-radius: 1px;
}

nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

nav::-webkit-scrollbar {
  height: 4px;
}

nav::-webkit-scrollbar-track {
  background: transparent;
}

nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.tab-content {
  min-height: 0;
  overflow-y: auto;
}

.tab-content::-webkit-scrollbar {
  width: 6px;
}

.tab-content::-webkit-scrollbar-track {
  background: transparent;
}

.tab-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

button.status-badge {
  cursor: pointer;
  border: none;
}

button.status-badge:hover {
  filter: brightness(1.06);
}

button.status-badge:focus-visible {
  outline: 2px solid var(--color-primary, #3b82f6);
  outline-offset: 2px;
}

.status-active {
  background: linear-gradient(135deg, #34c759 0%, #30a46c 100%);
  color: white;
}

.status-paused {
  background: linear-gradient(135deg, #8e8e93 0%, #636366 100%);
  color: white;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success,
.badge-warning,
.badge-error,
.badge-info {
  color: white;
}

.badge-success {
  background: #34c759;
}

.badge-warning {
  background: #ff9500;
}

.badge-error {
  background: #ff3b30;
}

.badge-info {
  background: #007aff;
}

.badge-pending {
  background: linear-gradient(135deg, #8e8e93 0%, #636366 100%);
  color: white;
}

.badge-expired {
  background: linear-gradient(135deg, #af52de 0%, #9d4edd 100%);
  color: white;
}

.badge-timeout {
  background: linear-gradient(135deg, #ff6b00 0%, #ff5500 100%);
  color: white;
}

.badge-accepted {
  background: linear-gradient(135deg, #32d74b 0%, #28cd41 100%);
  color: white;
}

.badge-enroute {
  background: linear-gradient(135deg, #5ac8fa 0%, #0a84ff 100%);
  color: white;
}

.badge-unknown {
  background: linear-gradient(135deg, #aeaeb2 0%, #8e8e93 100%);
  color: white;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-icon:active {
  transform: translateY(0);
}

.btn-icon-edit {
  background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
  color: white;
}

.btn-icon-edit:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004299 100%);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-icon-delete {
  background: linear-gradient(135deg, #ff3b30 0%, #e34850 100%);
  color: white;
}

.btn-icon-delete:hover {
  background: linear-gradient(135deg, #e34850 0%, #d32f2f 100%);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.btn-icon-add {
  background: linear-gradient(135deg, #34c759 0%, #30a46c 100%);
  color: white;
}

.btn-icon-add:hover {
  background: linear-gradient(135deg, #30a46c 0%, #28a745 100%);
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.btn-icon-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
}

.btn-icon-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-icon-small:active {
  transform: translateY(0);
}

.btn-icon-small.btn-icon-add {
  background: linear-gradient(135deg, #34c759 0%, #30a46c 100%);
  color: white;
}

.btn-icon-small.btn-icon-add:hover {
  background: linear-gradient(135deg, #30a46c 0%, #28a745 100%);
  box-shadow: 0 2px 6px rgba(52, 199, 89, 0.3);
}

.btn-icon-small.btn-icon-delete {
  background: linear-gradient(135deg, #ff3b30 0%, #e34850 100%);
  color: white;
}

.btn-icon-small.btn-icon-delete:hover {
  background: linear-gradient(135deg, #e34850 0%, #d32f2f 100%);
  box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3);
}

#notification-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 12px 12px 13px;
  border-radius: 12px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  box-shadow:
    0 1px 2px rgba(17, 24, 39, 0.04),
    0 8px 24px -8px rgba(17, 24, 39, 0.18);
  font-family: var(--font-sans, "Inter", sans-serif);
  pointer-events: auto;
  overflow: hidden;
  animation: toast-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  margin-top: 1px;
}

.toast-body {
  min-width: 0;
}

.toast-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
  color: var(--color-heading, #111827);
}

.toast-message {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--color-muted, #4b5563);
  overflow-wrap: anywhere;
}

.toast-close {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-dim, #9ca3af);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition:
    background 140ms ease,
    color 140ms ease;
}

.toast-close:hover {
  background: var(--color-surface-muted, #f3f4f6);
  color: var(--color-body, #374151);
}

.toast-close:focus-visible {
  outline: 2px solid var(--color-primary, #007aff);
  outline-offset: 1px;
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left center;
  opacity: 0.65;
  animation: toast-progress linear forwards;
}

.toast:hover .toast-progress,
.toast:focus-within .toast-progress {
  animation-play-state: paused;
}

.toast-success .toast-icon,
.toast-success .toast-progress {
  background: var(--color-success, #34c759);
}

.toast-error .toast-icon,
.toast-error .toast-progress {
  background: var(--color-error, #ff3b30);
}

.toast-warning .toast-icon,
.toast-warning .toast-progress {
  background: var(--color-warning, #ff9500);
}

.toast-info .toast-icon,
.toast-info .toast-progress {
  background: var(--color-primary, #007aff);
}

.toast.toast-out {
  animation: toast-out 180ms ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(16px, -4px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translate3d(12px, 0, 0) scale(0.97);
  }
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.dark .toast {
  background: var(--color-surface, #242426);
  border-color: var(--color-border, rgba(255, 255, 255, 0.12));
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 10px 28px -10px rgba(0, 0, 0, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.toast-out {
    animation: none;
  }
  .toast-progress {
    display: none;
  }
}

#message-details * {
  max-width: 100%;
  overflow-wrap: break-word;
}

.diff-removed {
  background-color: #fecaca;
  color: #991b1b;
  text-decoration: line-through;
}

.diff-added {
  background-color: #bbf7d0;
  color: #166534;
}

.dark .diff-removed {
  background-color: #7f1d1d;
  color: #fecaca;
}

.dark .diff-added {
  background-color: #14532d;
  color: #bbf7d0;
}

.dark {
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.dark ::-webkit-scrollbar {
  width: 6px;
  height: 4px;
}

.dark ::-webkit-scrollbar-track {
  background: transparent;
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.dashboard-shell {
  min-height: calc(100dvh - 130px);
}

.table-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.clients-table-min {
  min-width: 920px;
}

.responsive-header {
  flex-wrap: wrap;
  align-items: flex-start;
}

.responsive-actions {
  width: 100%;
  max-width: none;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.responsive-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
}

.responsive-filter-item {
  flex: 1 1 100%;
}

.filter-multiselect.responsive-filter-item,
.stats-group-by-dropdown.responsive-filter-item {
  min-width: 0;
}

.responsive-filter-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.responsive-filter-actions > button {
  flex: 1 1 auto;
}

@media (min-width: 768px) {
  .responsive-actions {
    width: auto;
    max-width: 32rem;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }
}

@media (min-width: 1200px) {
  .responsive-filters {
    flex-wrap: wrap;
    overflow-x: visible;
    overflow-y: visible;
  }

  .responsive-filter-item {
    flex: 1 1 0;
  }

  .responsive-filter-actions {
    flex: 0 0 auto;
    width: auto;
  }

  .responsive-filter-actions > button {
    flex: none;
    white-space: nowrap;
  }
}

.search-textarea-wrap {
  position: relative;
  width: 12rem;
  min-width: 12rem;
  height: 2.5rem;
  flex: none;
}

.input-auto-expand {
  width: 100%;
  height: 2.5rem;
  min-height: 2.5rem;
  max-height: 30rem;
  box-sizing: border-box;
  line-height: 1.5rem;
  overflow-x: hidden;
  overflow-y: hidden;
  resize: none;
}

.input-auto-expand.is-expanded {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 40;
  background: var(--color-surface);
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.2);
}

#statistics-tab .search-textarea-wrap {
  width: 12rem;
  min-width: 12rem;
}

@media (max-width: 640px) {
  .tab-content {
    padding: 12px;
  }

  .tab-content h2 {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .btn-icon {
    width: 40px;
    height: 40px;
  }
}
