:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #10212b;
  --muted: #5d6f7c;
  --accent: #0f766e;
  --danger: #b42318;
  --border: #d8e1e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 15%, #d6f0ea 0, transparent 35%), var(--bg);
}

h1, h2, h3 {
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
}

.app-header-wrapper {
  width: 100%;
  min-height: 120px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  background: #1b1035;
  border-bottom: 1px solid #3b225f;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 60px;
  min-width: max-content;
  background: transparent;
  color: var(--text);
  border-bottom: none;
  overflow: visible;
}

.module-pagination {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.module-pagination-count {
  margin: 0;
  min-width: max-content;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.module-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.module-pagination-controls > * {
  flex: 0 0 auto;
}

.module-pagination-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.module-pagination-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 72px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}

.module-pagination-select:disabled,
.module-pagination-controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.module-pagination-page {
  min-width: 52px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
}

.field-error {
  display: block;
  margin-top: 2px;
  color: #fecaca;
  font-size: 12px;
  line-height: 1.4;
}

.field-error[hidden] {
  display: none !important;
}

.toast-container {
  position: fixed;
  top: 14px;
  left: 50%;
  width: min(420px, calc(100vw - 24px));
  min-height: 92px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 220;
}

.toast-card {
  --toast-stack-offset: 0px;
  --toast-stack-scale: 1;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--toast-border-color, #4a2d78);
  background: linear-gradient(160deg, rgba(28, 16, 53, 0.98), rgba(14, 8, 27, 0.96));
  color: var(--toast-text-color, #f4eaff);
  box-shadow: 0 20px 42px rgba(6, 3, 15, 0.4);
  opacity: 0;
  transform: translateY(calc(-120% + var(--toast-stack-offset))) scale(var(--toast-stack-scale));
  transform-origin: top center;
  transition: transform 300ms ease, opacity 400ms ease, box-shadow 300ms ease;
}

.toast-card.is-visible {
  opacity: 1;
  transform: translateY(var(--toast-stack-offset)) scale(var(--toast-stack-scale));
}

.toast-card.is-leaving {
  opacity: 0;
  transform: translateY(calc(-18px + var(--toast-stack-offset))) scale(var(--toast-stack-scale));
}

.toast-card.is-hidden-stack {
  opacity: 0;
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.08);
}

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

.toast-message {
  margin: 0;
  color: inherit;
  line-height: 1.4;
}

.toast-card.is-info {
  border-color: rgba(99, 102, 241, 0.7);
}

.toast-card.is-info .toast-icon {
  color: #c7d2fe;
}

.toast-card.is-success {
  border-color: rgba(52, 211, 153, 0.7);
}

.toast-card.is-success .toast-icon {
  color: #86efac;
}

.toast-card.is-error {
  border-color: rgba(248, 113, 113, 0.78);
}

.toast-card.is-error .toast-icon {
  color: #fecaca;
}

.toast-card.is-warning {
  border-color: rgba(251, 191, 36, 0.78);
}

.toast-card.is-warning .toast-icon {
  color: #fde68a;
}

@media (max-width: 900px) {
  .toast-container {
    top: 12px;
    width: min(360px, calc(100vw - 20px));
    min-height: 88px;
  }

  .toast-card {
    gap: 10px;
    padding: 12px 14px;
  }
}
