@import url("https://fonts.googleapis.com/css2?family=Almarai:wght@400;700;800&family=Cairo:wght@400;500;600;700;800&family=Changa:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700&family=Tajawal:wght@400;500;600;700;800;900&display=swap");

:root {
  --font-body: "Tajawal", "Segoe UI", sans-serif;
  --font-display: "Cairo", "Tajawal", sans-serif;
  --ink: #171916;
  --ink-soft: #4e534d;
  --muted: #828880;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --surface-3: #eeefeb;
  --canvas: #f4f5f1;
  --line: #e2e4de;
  --line-strong: #cfd3cb;
  --primary: #ef5b3f;
  --primary-dark: #d9472e;
  --primary-soft: #fff0eb;
  --secondary: #7457e8;
  --secondary-soft: #f0edff;
  --success: #16865f;
  --success-soft: #e8f7f1;
  --warning: #b87912;
  --warning-soft: #fff4dc;
  --danger: #d44242;
  --danger-soft: #fff0f0;
  --info: #3478c9;
  --info-soft: #ebf4ff;
  --shadow-xs: 0 1px 2px rgba(18, 22, 17, 0.04);
  --shadow-sm: 0 4px 14px rgba(22, 26, 21, 0.06);
  --shadow-md: 0 14px 38px rgba(22, 26, 21, 0.09);
  --shadow-lg: 0 28px 80px rgba(15, 18, 15, 0.15);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --transition: 180ms cubic-bezier(0.2, 0.75, 0.25, 1);
  --container: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  max-width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.modal-open,
body.drawer-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  object-fit: cover;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.25;
}

ul,
ol {
  padding-inline-start: 1.2rem;
}

::selection {
  color: #fff;
  background: var(--primary);
}

:focus-visible {
  outline: 3px solid rgba(239, 91, 63, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.container--wide {
  width: min(calc(100% - 40px), 1440px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, 16px);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, 10px);
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand img {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(23, 25, 22, 0.15);
}

.brand span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.brand strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand--dark strong {
  color: #fff;
}

.brand--dark small {
  color: rgba(255, 255, 255, 0.55);
}

.brand--compact img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

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

.button:active {
  transform: translateY(0) scale(0.98);
}

.button:disabled,
.button.is-disabled {
  opacity: 0.48;
  pointer-events: none;
}

.button--primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(239, 91, 63, 0.2);
}

.button--primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 26px rgba(239, 91, 63, 0.27);
}

.button--dark {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(23, 25, 22, 0.16);
}

.button--dark:hover {
  background: #272a26;
}

.button--secondary {
  color: #fff;
  background: var(--secondary);
  box-shadow: 0 8px 20px rgba(116, 87, 232, 0.2);
}

.button--ghost {
  border-color: var(--line);
  background: var(--surface);
}

.button--ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.button--soft {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.button--soft:hover {
  background: #ffe5dc;
}

.button--success {
  color: #fff;
  background: var(--success);
}

.button--danger {
  color: #fff;
  background: var(--danger);
}

.button--danger-soft {
  color: var(--danger);
  background: var(--danger-soft);
}

.button--link {
  min-height: auto;
  padding: 4px;
  color: var(--primary-dark);
}

.button--sm {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.button--lg {
  min-height: 52px;
  padding: 13px 22px;
  border-radius: 15px;
  font-size: 15px;
}

.button--block {
  width: 100%;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-soft);
  background: var(--surface);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.icon-button--soft {
  border-color: transparent;
  background: var(--surface-2);
}

.icon-button--danger:hover {
  border-color: #f5caca;
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-button .notification-dot {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 6px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.card--raised {
  border-color: rgba(226, 228, 222, 0.75);
  box-shadow: var(--shadow-sm);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 0;
}

.card__header h2,
.card__header h3 {
  margin-bottom: 3px;
  font-size: 17px;
}

.card__header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.card__body {
  padding: 20px;
}

.card__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.eyebrow {
  display: block;
  min-height: 0;
  margin-bottom: 5px;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h1,
.section-heading h2 {
  margin-bottom: 5px;
}

.section-heading p {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > label,
.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.field__label small,
.field__hint {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input::placeholder,
.textarea::placeholder {
  color: #a6aaa4;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(239, 91, 63, 0.09);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  color: var(--muted);
  background: var(--surface-2);
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.select {
  padding-inline-end: 34px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7d827b 50%), linear-gradient(135deg, #7d827b 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

[dir="rtl"] .select {
  background-position: 17px 19px, 12px 19px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group > svg,
.input-group > i,
.input-group__icon {
  position: absolute;
  inset-inline-start: 13px;
  z-index: 1;
  color: var(--muted);
  pointer-events: none;
}

.input-group .input {
  padding-inline-start: 41px;
}

.input-group .input-group__action {
  position: absolute;
  inset-inline-end: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
}

.input-group:has(.input-group__action) .input {
  padding-inline-end: 42px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.checkbox,
.radio {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
}

.checkbox input,
.radio input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: #cfd3cc;
  transition: background var(--transition);
}

.switch__track::after {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform var(--transition);
}

.switch input:checked + .switch__track {
  background: var(--success);
}

.switch input:checked + .switch__track::after {
  transform: translateX(18px);
}

[dir="rtl"] .switch input:checked + .switch__track::after {
  transform: translateX(-18px);
}

.switch__label {
  font-size: 12px;
  font-weight: 600;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.segmented button,
.segmented a {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all var(--transition);
}

.segmented button.is-active,
.segmented a.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.tab::after {
  position: absolute;
  inset-block-end: -1px;
  inset-inline: 14px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  content: "";
}

.tab.is-active {
  color: var(--ink);
}

.tab.is-active::after {
  background: var(--primary);
}

.chip,
.tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.chip--primary {
  border-color: rgba(239, 91, 63, 0.2);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.chip--dark {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.language-switcher {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.language-chip {
  min-width: 34px;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.language-chip.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--secondary), #a969e9);
  font-size: 11px;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
}

.avatar--sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 9px;
}

.avatar--lg {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 14px;
}

.status {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status--active,
.status--available,
.status--paid,
.status--completed,
.status--ready {
  color: var(--success);
  background: var(--success-soft);
}

.status--trial,
.status--new,
.status--scheduled,
.status--invited {
  color: var(--info);
  background: var(--info-soft);
}

.status--preparing,
.status--paused,
.status--draft {
  color: var(--warning);
  background: var(--warning-soft);
}

.status--sold-out,
.status--expired,
.status--suspended,
.status--cancelled,
.status--failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.status--hidden,
.status--inactive,
.status--refunded {
  color: #6f746e;
  background: #eff0ed;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  background: #fafbf8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--ink-soft);
  font-size: 12px;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: #fcfcfa;
}

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

.table-entity {
  display: flex;
  min-width: 170px;
  align-items: center;
  gap: 10px;
}

.table-entity__image {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--surface-2);
}

.table-entity strong,
.table-entity span {
  display: block;
}

.table-entity strong {
  max-width: 220px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
}

.table-entity span {
  color: var(--muted);
  font-size: 10px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.row-actions .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolbar .search-control {
  width: min(100%, 310px);
}

.dropdown {
  position: relative;
}

.dropdown__menu {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 60;
  width: 210px;
  padding: 7px;
  visibility: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  opacity: 0;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateY(-5px);
  transition: all var(--transition);
}

.dropdown.is-open .dropdown__menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.dropdown__menu a,
.dropdown__menu button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: start;
}

.dropdown__menu a:hover,
.dropdown__menu button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.dropdown__divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  padding: 34px;
  text-align: center;
}

.empty-state img {
  width: 180px;
  margin: 0 auto 16px;
}

.empty-state h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.empty-state p {
  max-width: 370px;
  margin: 0 auto 17px;
  color: var(--muted);
  font-size: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.pagination__buttons {
  display: flex;
  gap: 5px;
}

.pagination__buttons button {
  display: grid;
  min-width: 31px;
  height: 31px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 10px;
}

.pagination__buttons button.is-active {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 22px;
  visibility: hidden;
  opacity: 0;
  background: rgba(15, 18, 15, 0.55);
  backdrop-filter: blur(8px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.modal-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

.modal {
  display: flex;
  width: min(100%, 600px);
  max-height: min(90vh, 860px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.98);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal--small {
  width: min(100%, 430px);
}

.modal--large {
  width: min(100%, 880px);
}

.modal--xlarge {
  width: min(100%, 1160px);
}

.modal__header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal__header h2 {
  margin-bottom: 2px;
  font-size: 19px;
}

.modal__header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

.modal__body {
  padding: 21px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fafbf9;
}

.confirm-message {
  display: grid;
  gap: 13px;
  place-items: center;
  padding: 10px 4px;
  text-align: center;
}

.confirm-message__icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 18px;
  color: var(--danger);
  background: var(--danger-soft);
}

.confirm-message p {
  margin: 0;
  color: var(--ink-soft);
}

.toast-stack {
  position: fixed;
  inset-block-start: 18px;
  inset-inline-end: 18px;
  z-index: 2000;
  display: grid;
  width: min(calc(100vw - 36px), 370px);
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  opacity: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  transform: translateX(calc((var(--direction-multiplier, 1)) * -18px));
  transition: opacity 220ms ease, transform 220ms ease;
}

[dir="ltr"] .toast {
  --direction-multiplier: -1;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--success);
  background: var(--success-soft);
}

.toast--error .toast__icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast--warning .toast__icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.toast--info .toast__icon {
  color: var(--info);
  background: var(--info-soft);
}

.toast strong,
.toast p {
  display: block;
  margin: 0;
}

.toast strong {
  font-size: 12px;
}

.toast p {
  color: var(--muted);
  font-size: 10px;
}

.toast__close {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  color: transparent !important;
  background: #e9ebe6 !important;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
}

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 500ms ease;
}

.tooltip {
  position: relative;
}

.tooltip::after {
  position: absolute;
  inset-block-end: calc(100% + 7px);
  inset-inline-start: 50%;
  z-index: 80;
  padding: 5px 8px;
  visibility: hidden;
  border-radius: 7px;
  opacity: 0;
  color: #fff;
  background: var(--ink);
  content: attr(data-tooltip);
  font-size: 9px;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: all var(--transition);
  white-space: nowrap;
}

[dir="rtl"] .tooltip::after {
  transform: translate(50%, 4px);
}

.tooltip:hover::after,
.tooltip:focus-visible::after {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

[dir="rtl"] .tooltip:hover::after,
[dir="rtl"] .tooltip:focus-visible::after {
  transform: translate(50%, 0);
}

.upload-zone {
  position: relative;
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 20px;
  overflow: hidden;
  border: 1.5px dashed var(--line-strong);
  border-radius: 15px;
  color: var(--muted);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone__icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 9px;
  place-items: center;
  border-radius: 13px;
  color: var(--primary);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.upload-zone strong,
.upload-zone small {
  display: block;
}

.upload-zone strong {
  color: var(--ink);
  font-size: 12px;
}

.upload-zone small {
  font-size: 10px;
}

.color-input {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.color-input input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}

.divider {
  height: 1px;
  margin: 6px 0;
  background: var(--line);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #d9e8fb;
  border-radius: 12px;
  color: #2c5f9c;
  background: var(--info-soft);
  font-size: 11px;
}

.notice--warning {
  border-color: #f0dba8;
  color: #8b6318;
  background: var(--warning-soft);
}

.notice--success {
  border-color: #c9eadc;
  color: #146e50;
  background: var(--success-soft);
}

.notice p {
  margin: 0;
}

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
}

.metric-change--down {
  color: var(--danger);
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spin-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes float {
  50% { transform: translateY(-7px); }
}

@keyframes pulse-soft {
  50% { opacity: 0.62; }
}

@media (max-width: 900px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container,
  .container--wide {
    width: min(calc(100% - 28px), var(--container));
  }

  .grid--2,
  .grid--3,
  .grid--4,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .toolbar__group {
    width: 100%;
    align-items: stretch;
  }

  .toolbar__group > .button,
  .toolbar__group > .select,
  .toolbar__group > .segmented {
    flex: 1 1 auto;
  }

  .toolbar .search-control {
    width: 100%;
  }

  .modal-overlay {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal--small,
  .modal--large,
  .modal--xlarge {
    width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }

  .modal-overlay.is-open .modal {
    transform: translateY(0);
  }

  .modal__header,
  .modal__body,
  .modal__footer {
    padding-inline: 16px;
  }

  .modal__footer {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .modal__footer .button {
    flex: 1;
  }

  .toast-stack {
    inset-block-start: auto;
    inset-block-end: max(14px, env(safe-area-inset-bottom));
    inset-inline: 14px;
    width: auto;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
