:root {
  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-surface-alt: #eef4ff;
  --app-border: rgba(15, 23, 42, 0.08);
  --app-border-strong: rgba(15, 23, 42, 0.14);
  --app-text: #10213a;
  --app-text-soft: #5f708c;
  --app-title: #0b1220;
  --app-primary: #1565c0;
  --app-primary-strong: #0f4c92;
  --app-success: #0b8d66;
  --app-warning: #e59a19;
  --app-danger: #c44747;
  --app-info: #4b67d1;
  --app-shadow: 0 24px 60px rgba(15, 23, 42, 0.09);
  --app-radius-lg: 28px;
  --app-radius-md: 20px;
  --app-radius-sm: 14px;
  --app-font: "Segoe UI", "Helvetica Neue", sans-serif;
}

body.admin-body {
  background:
    radial-gradient(circle at top left, rgba(21, 101, 192, 0.18), transparent 26%),
    linear-gradient(180deg, #eaf1fb 0%, #f4f7fb 100%);
  color: var(--app-text);
  font-family: var(--app-font);
}

#spa-admin-root {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  transition: grid-template-columns 0.2s ease;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 104px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  background:
    linear-gradient(180deg, rgba(8, 19, 37, 0.98), rgba(12, 32, 59, 0.96)),
    #0a172d;
  color: #edf4ff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  z-index: 24;
  transition: width 0.2s ease, padding 0.2s ease, transform 0.2s ease;
}

.app-sidebar-backdrop {
  display: none;
}

.app-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.app-brand-mark {
  width: 84px;
  height: 84px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.2), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(12, 24, 43, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 22px 42px rgba(4, 11, 26, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.app-brand-mark img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-nav-group-title {
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.56;
}

.app-nav-group-links {
  display: grid;
  gap: 8px;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.app-nav-link:hover,
.app-nav-link.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(3px);
}

.app-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
}

.app-sidebar-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(237, 244, 255, 0.78);
}

.app-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-sidebar-user {
  font-weight: 700;
}

.app-sidebar-role {
  margin-top: 4px;
  font-size: 13px;
}

.app-shell.is-sidebar-collapsed .app-nav-group-title,
.app-shell.is-sidebar-collapsed .app-nav-copy,
.app-shell.is-sidebar-collapsed .app-sidebar-footer {
  display: none;
}

.app-shell.is-sidebar-collapsed .app-sidebar {
  padding-left: 14px;
  padding-right: 14px;
}

.app-shell.is-sidebar-collapsed .app-nav-link {
  justify-content: center;
  padding-left: 12px;
  padding-right: 12px;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 0;
}

.app-topbar-left,
.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-locale-switch {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.78);
}

.app-locale-button {
  min-width: 48px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--app-text-soft);
  font-weight: 700;
}

.app-locale-button.is-active {
  background: linear-gradient(135deg, var(--app-primary), #1b7bc9);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(21, 101, 192, 0.2);
}

.app-topbar-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--app-text-soft);
}

.app-topbar-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--app-title);
}

.app-topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-text-soft);
}

.app-user-menu {
  position: relative;
}

.app-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--app-title);
  box-shadow: var(--app-shadow);
}

.app-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--app-primary), #1b7bc9);
  color: #ffffff;
  font-weight: 700;
}

.app-user-copy {
  display: grid;
  text-align: left;
}

.app-user-name {
  font-weight: 700;
}

.app-user-meta {
  color: var(--app-text-soft);
  font-size: 12px;
}

.app-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--app-border);
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  z-index: 50;
}

.app-user-dropdown-head {
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--app-border);
  margin-bottom: 10px;
}

.app-user-dropdown-title {
  font-weight: 700;
}

.app-user-dropdown-subtitle {
  margin-top: 4px;
  color: var(--app-text-soft);
  font-size: 13px;
}

.app-user-dropdown-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  width: 100%;
  padding: 0 10px;
  border: 0;
  background: transparent;
  border-radius: 14px;
  color: var(--app-title);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.app-user-dropdown-link:hover {
  background: rgba(21, 101, 192, 0.08);
}

.app-public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar-public {
  padding-bottom: 0;
  justify-content: flex-end;
}

.app-topbar-public .app-topbar-right {
  width: 100%;
  justify-content: flex-end;
}

.app-brand-public {
  margin-bottom: 0;
}

.app-brand-mark-public {
  width: 104px;
  height: 104px;
  border-radius: 32px;
}

.app-brand-mark-public img {
  width: 72px;
  height: 72px;
}

.app-public-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 28px 40px;
}

.app-auth-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  max-width: 1240px;
  margin: 0 auto;
  gap: 36px;
  align-items: center;
}

.app-auth-copy {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.app-auth-copy-rich {
  align-items: stretch;
}

.app-auth-copy .app-page-hero {
  margin-bottom: 0;
  width: min(100%, 640px);
}

.app-auth-copy .app-page-title {
  max-width: 14ch;
}

.app-auth-copy .app-page-subtitle {
  max-width: 56ch;
}

.app-auth-panel {
  max-width: 560px;
  width: 100%;
  justify-self: end;
}

.app-auth-panel-stack {
  display: grid;
  gap: 18px;
}

.app-auth-panel-shell {
  position: relative;
}

.app-auth-hero-panel {
  position: relative;
  width: min(100%, 700px);
  padding: 34px;
  border-radius: 36px;
  border: 1px solid rgba(21, 101, 192, 0.12);
  background:
    radial-gradient(circle at top right, rgba(21, 101, 192, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(238, 244, 255, 0.92));
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.app-auth-hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(21, 101, 192, 0.08);
}

.app-auth-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 264px;
  max-width: 100%;
  margin-bottom: 28px;
  padding: 20px 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(8, 19, 37, 0.84), rgba(12, 32, 59, 0.86)),
    rgba(8, 19, 37, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
}

.app-auth-logo {
  width: 100%;
  height: auto;
  display: block;
}

.app-auth-copy-stack {
  position: relative;
  z-index: 1;
}

.app-auth-hero-title {
  max-width: 12ch;
}

.app-auth-hero-subtitle {
  max-width: 54ch;
}

.app-auth-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.app-auth-feature-card {
  min-width: 0;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(21, 101, 192, 0.1);
  background: rgba(255, 255, 255, 0.74);
}

.app-auth-feature-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--app-primary);
}

.app-auth-feature-copy {
  margin-top: 10px;
  color: var(--app-text-soft);
  line-height: 1.6;
  font-size: 14px;
}

.app-auth-form-card {
  position: relative;
}

.app-auth-support-card {
  background: rgba(255, 255, 255, 0.78);
}

.app-auth-footer {
  display: grid;
  gap: 12px;
}

.app-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--app-warning);
  box-shadow: 0 0 0 4px rgba(229, 154, 25, 0.16);
}

.app-status-dot.is-online {
  background: var(--app-success);
  box-shadow: 0 0 0 4px rgba(11, 141, 102, 0.14);
}

.app-content {
  padding: 20px 28px 36px;
}

.app-page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.app-page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--app-primary);
  font-weight: 700;
}

.app-page-title {
  margin: 10px 0 8px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.05;
  color: var(--app-title);
}

.app-page-subtitle {
  max-width: 720px;
  margin: 0;
  color: var(--app-text-soft);
  font-size: 15px;
  line-height: 1.6;
}

.app-page-meta,
.app-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.app-grid,
.app-grid-2,
.app-grid-3 {
  display: grid;
  gap: 18px;
}

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

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

.app-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow);
}

.app-card-header {
  padding: 22px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.app-card-title {
  margin: 0;
  font-size: 20px;
  color: var(--app-title);
}

.app-card-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--app-text-soft);
}

.app-card-body {
  padding: 22px 24px 24px;
  min-width: 0;
}

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

.app-stat-card {
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 246, 255, 0.92)),
    var(--app-surface);
  border: 1px solid rgba(21, 101, 192, 0.08);
  box-shadow: var(--app-shadow);
}

.app-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-stat-label {
  color: var(--app-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.app-stat-value {
  margin-top: 18px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
  font-weight: 700;
  color: var(--app-title);
}

.app-stat-hint {
  margin-top: 10px;
  color: var(--app-text-soft);
  font-size: 14px;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.app-badge-neutral {
  background: rgba(16, 33, 58, 0.08);
  color: var(--app-text);
}

.app-badge-success {
  background: rgba(11, 141, 102, 0.12);
  color: var(--app-success);
}

.app-badge-warning {
  background: rgba(229, 154, 25, 0.15);
  color: #9a6200;
}

.app-badge-danger {
  background: rgba(196, 71, 71, 0.14);
  color: var(--app-danger);
}

.app-badge-info {
  background: rgba(75, 103, 209, 0.12);
  color: var(--app-info);
}

.app-button,
.app-icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 700;
  text-decoration: none;
}

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

.app-button-primary {
  background: linear-gradient(135deg, var(--app-primary), #1c82d2);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(21, 101, 192, 0.26);
}

.app-button-secondary {
  background: linear-gradient(135deg, #12325d, #234f84);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(16, 33, 58, 0.22);
}

.app-button-ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--app-title);
  border: 1px solid var(--app-border);
}

.app-button-danger {
  background: linear-gradient(135deg, #b93f3f, #d25b5b);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(185, 63, 63, 0.22);
}

.app-button-sm {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 14px;
  font-size: 13px;
}

.app-button[disabled],
.app-icon-button[disabled] {
  opacity: 0.56;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.app-icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--app-title);
  border: 1px solid var(--app-border);
}

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

.app-info-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--app-surface-alt);
  border: 1px solid rgba(21, 101, 192, 0.08);
}

.app-info-label {
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--app-text-soft);
}

.app-info-value {
  font-size: 15px;
  color: var(--app-title);
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.app-info-value.is-monospace {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
}

.app-alert {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid transparent;
}

.app-alert-info {
  background: rgba(75, 103, 209, 0.08);
  border-color: rgba(75, 103, 209, 0.16);
}

.app-alert-warning {
  background: rgba(229, 154, 25, 0.1);
  border-color: rgba(229, 154, 25, 0.18);
}

.app-alert-danger {
  background: rgba(196, 71, 71, 0.1);
  border-color: rgba(196, 71, 71, 0.18);
}

.app-alert-title {
  font-weight: 700;
  color: var(--app-title);
}

.app-alert-copy {
  margin-top: 4px;
  color: var(--app-text-soft);
}

.app-field {
  display: grid;
  gap: 8px;
}

.app-field-label {
  color: var(--app-title);
  font-weight: 700;
  font-size: 14px;
}

.app-field-hint,
.app-muted {
  color: var(--app-text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.app-input,
.app-select,
.app-textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--app-border-strong);
  border-radius: 16px;
  background: #ffffff;
  color: var(--app-title);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

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

.app-input:focus,
.app-select:focus,
.app-textarea:focus {
  border-color: rgba(21, 101, 192, 0.46);
  box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.12);
}

.app-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.app-switch {
  position: relative;
  display: inline-flex;
  width: 54px;
  height: 32px;
}

.app-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.app-switch-slider {
  width: 100%;
  border-radius: 999px;
  background: rgba(16, 33, 58, 0.14);
  transition: background-color 0.16s ease;
}

.app-switch-slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 33, 58, 0.18);
  transition: transform 0.16s ease;
}

.app-switch input:checked + .app-switch-slider {
  background: rgba(21, 101, 192, 0.72);
}

.app-switch input:checked + .app-switch-slider::before {
  transform: translateX(22px);
}

.app-compact-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.app-compact-switch-label {
  color: var(--app-text-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.app-checkbox-list {
  display: grid;
  gap: 12px;
}

.app-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.7);
}

.app-checkbox-card input {
  margin-top: 3px;
}

.app-checkbox-copy {
  display: grid;
  gap: 4px;
}

.app-checkbox-label {
  font-weight: 700;
}

.app-checkbox-hint {
  font-size: 13px;
  color: var(--app-text-soft);
}

.app-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--app-border);
}

.app-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-weight: 700;
  color: var(--app-text-soft);
}

.app-tab.is-active {
  background: linear-gradient(135deg, var(--app-primary), #1b7bc9);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(21, 101, 192, 0.2);
}

.app-table-wrap {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.app-table th,
.app-table td {
  padding: 14px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--app-border);
}

.app-table th {
  color: var(--app-text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.app-table td {
  color: var(--app-title);
}

.app-mobile-only {
  display: none;
}

.app-mobile-list {
  display: grid;
  gap: 14px;
}

.app-mobile-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.app-mobile-row {
  display: grid;
  gap: 6px;
  padding-block: 8px;
}

.app-mobile-row + .app-mobile-row {
  border-top: 1px solid var(--app-border);
}

.app-mobile-label {
  color: var(--app-text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.app-empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 36px 18px;
  text-align: center;
}

.app-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(21, 101, 192, 0.1);
  color: var(--app-primary);
  font-size: 24px;
}

.app-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--app-title);
}

.app-empty-copy {
  max-width: 520px;
  color: var(--app-text-soft);
}

.app-loader-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.84);
}

.app-loader-shimmer {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(21, 101, 192, 0.12), rgba(21, 101, 192, 0.24));
  animation: pulse 1.1s ease-in-out infinite alternate;
}

.app-loader-title {
  font-weight: 700;
}

.app-loader-text {
  margin-top: 4px;
  color: var(--app-text-soft);
}

.app-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 12px;
  z-index: 120;
}

.app-toast {
  min-width: 320px;
  max-width: 440px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.18);
  color: #ffffff;
}

.app-toast-success {
  background: linear-gradient(135deg, #0c825f, #119b74);
}

.app-toast-error {
  background: linear-gradient(135deg, #a53d3d, #c85353);
}

.app-toast-title {
  font-weight: 700;
}

.app-toast-description {
  margin-top: 4px;
  font-size: 14px;
  opacity: 0.92;
}

.app-drawer-backdrop,
.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 18, 34, 0.42);
  backdrop-filter: blur(6px);
  z-index: 100;
}

.app-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(620px, 100vw);
  background: #ffffff;
  box-shadow: -16px 0 50px rgba(15, 23, 42, 0.18);
  z-index: 101;
  display: flex;
  flex-direction: column;
}

.app-drawer.is-wide {
  width: min(860px, 100vw);
}

.app-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 0;
}

.app-drawer-kicker {
  color: var(--app-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
}

.app-drawer-title {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 700;
}

.app-drawer-subtitle {
  margin-top: 8px;
  color: var(--app-text-soft);
  line-height: 1.5;
}

.app-drawer-body {
  padding: 22px;
  overflow: auto;
}

.app-drawer .app-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.app-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 24px));
  padding: 24px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
  z-index: 101;
}

.app-dialog-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--app-title);
}

.app-dialog-copy {
  margin-top: 10px;
  color: var(--app-text-soft);
  line-height: 1.6;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.app-result-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.88);
}

.app-result-card.is-success {
  border-color: rgba(11, 141, 102, 0.22);
}

.app-result-card.is-error {
  border-color: rgba(196, 71, 71, 0.22);
}

.app-result-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-result-copy {
  margin-top: 12px;
  color: var(--app-text-soft);
}

.app-result-pre {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: #0f172a;
  color: #e5edf8;
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
}

.app-delivery-meta {
  display: grid;
  gap: 4px;
}

.app-action-row,
.app-form-actions,
.app-inline-actions,
.app-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.app-panel-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.app-channel-grid,
.app-secrets-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-user-channel-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.app-user-channel-card {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(21, 101, 192, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 255, 0.92)),
    var(--app-surface);
}

.app-user-channel-card.is-empty {
  background: rgba(244, 247, 251, 0.8);
}

.app-user-channel-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-user-channel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--app-title);
}

.app-user-channel-subtitle {
  margin-top: 6px;
  color: var(--app-text-soft);
  overflow-wrap: anywhere;
}

.app-user-channel-list {
  display: grid;
  gap: 10px;
}

.app-user-channel-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(112px, 140px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.app-user-channel-label {
  color: var(--app-text-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-user-channel-value {
  min-width: 0;
  color: var(--app-title);
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.app-user-channel-value.is-monospace {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
}

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

.app-restaurant-summary-card {
  height: 100%;
}

.app-restaurant-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.app-summary-block {
  min-width: 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--app-surface-alt);
  border: 1px solid rgba(21, 101, 192, 0.08);
}

.app-summary-block-span {
  grid-column: 1 / -1;
}

.app-summary-label {
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--app-text-soft);
}

.app-summary-value {
  font-size: 15px;
  color: var(--app-title);
  line-height: 1.55;
  word-break: break-word;
}

.app-summary-value.is-monospace {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
}

.app-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.app-section-block {
  display: grid;
  gap: 18px;
}

.app-master-detail {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.app-master-detail-sidebar,
.app-master-detail-content {
  min-width: 0;
}

.app-user-list {
  display: grid;
  gap: 10px;
}

.app-user-list-item {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--app-border);
  background: rgba(244, 247, 251, 0.78);
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.app-user-list-item:hover,
.app-user-list-item.is-selected {
  border-color: rgba(21, 101, 192, 0.26);
  background: rgba(230, 240, 255, 0.92);
  transform: translateY(-1px);
}

.app-user-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-user-list-title {
  font-weight: 700;
  color: var(--app-title);
}

.app-user-list-subtitle {
  margin-top: 4px;
  color: var(--app-text-soft);
  font-size: 14px;
}

.app-user-list-meta,
.app-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

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

.app-analytics-list {
  display: grid;
  gap: 14px;
}

.app-analytics-row {
  display: grid;
  gap: 8px;
}

.app-analytics-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-analytics-row-title {
  font-weight: 600;
}

.app-analytics-row-value {
  color: var(--app-text-soft);
  font-variant-numeric: tabular-nums;
}

.app-analytics-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.app-analytics-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.app-analytics-bar-fill.is-info {
  background: linear-gradient(90deg, #4b67d1, #6a8cff);
}

.app-analytics-bar-fill.is-success {
  background: linear-gradient(90deg, #0b8d66, #28b38a);
}

.app-analytics-bar-fill.is-warning {
  background: linear-gradient(90deg, #e59a19, #f4b437);
}

.app-analytics-bar-fill.is-neutral {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.app-timeline-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 10px;
  align-items: end;
}

.app-timeline-column {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.app-timeline-bars {
  min-height: 180px;
  width: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 6px;
}

.app-timeline-bar {
  width: 16px;
  border-radius: 999px 999px 6px 6px;
  min-height: 0;
}

.app-timeline-bar.is-total {
  background: linear-gradient(180deg, rgba(21, 101, 192, 0.28), var(--app-primary));
}

.app-timeline-bar.is-telegram {
  background: linear-gradient(180deg, rgba(75, 103, 209, 0.24), var(--app-info));
}

.app-timeline-bar.is-max {
  background: linear-gradient(180deg, rgba(229, 154, 25, 0.24), var(--app-warning));
}

.app-timeline-label,
.app-timeline-value {
  font-size: 12px;
  color: var(--app-text-soft);
}

.app-list-stack {
  display: grid;
  gap: 12px;
}

.app-list-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.72);
}

.app-list-title {
  font-weight: 700;
  color: var(--app-title);
}

.app-list-copy {
  margin-top: 6px;
  color: var(--app-text-soft);
  overflow-wrap: anywhere;
}

.app-secret-card {
  height: 100%;
}

.app-secret-value {
  padding: 16px 18px;
  border-radius: 18px;
  background: #0f172a;
  color: #e5edf8;
  line-height: 1.6;
  font-size: 13px;
  overflow: auto;
}

.app-secret-value.is-monospace {
  font-family: Consolas, "SFMono-Regular", monospace;
}

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

.app-situation-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.8);
}

.app-situation-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.app-situation-card-copy {
  display: grid;
  gap: 6px;
}

.app-situation-card-title {
  font-weight: 700;
  color: var(--app-title);
}

.app-situation-card-status {
  color: var(--app-text-soft);
  font-size: 13px;
}

.app-situation-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-text-soft);
  font-size: 13px;
  white-space: nowrap;
}

.app-situation-card-body {
  display: grid;
  gap: 10px;
}

.app-rule-groups {
  display: grid;
  gap: 16px;
}

.app-rule-group-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.76);
}

.app-rule-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.app-rule-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--app-title);
}

.app-rule-group-copy {
  color: var(--app-text-soft);
  font-variant-numeric: tabular-nums;
}

.app-category-event-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.app-category-event-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(244, 247, 251, 0.88);
}

.app-category-event-copy {
  min-width: 0;
}

.app-category-event-title {
  font-weight: 700;
  color: var(--app-title);
}

.app-category-event-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-rule-list {
  display: grid;
  gap: 12px;
}

.app-rule-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(244, 247, 251, 0.88);
}

.app-rule-item-main {
  min-width: 0;
}

.app-rule-item-title {
  font-weight: 700;
  color: var(--app-title);
}

.app-rule-item-copy {
  margin-top: 8px;
  color: var(--app-text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.app-rule-item-copy.is-empty {
  color: var(--app-text-soft);
}

.app-rule-item-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-situation-description {
  min-height: 96px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-alt);
  color: var(--app-title);
  line-height: 1.55;
  white-space: pre-wrap;
}

.app-situation-description.is-empty {
  color: var(--app-text-soft);
}

@keyframes pulse {
  from {
    opacity: 0.55;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

  .app-panel-grid {
    grid-template-columns: 1fr;
  }

  .app-panel-grid-wide,
  .app-panel-grid-analytics,
  .app-master-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, calc(100vw - 56px));
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .app-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 18, 34, 0.46);
    z-index: 23;
  }

  .app-topbar {
    padding-top: 18px;
  }

  .app-page-hero {
    flex-direction: column;
  }

  .app-auth-layout {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .app-auth-hero-panel {
    width: 100%;
  }

  .app-auth-feature-grid {
    grid-template-columns: 1fr;
  }

  .app-auth-panel {
    justify-self: stretch;
    max-width: none;
  }

  .app-auth-copy .app-page-title,
  .app-auth-copy .app-page-subtitle {
    max-width: none;
  }

  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-content,
  .app-topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .app-topbar-right {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .app-stat-grid,
  .app-grid-2,
  .app-grid-3,
  .app-info-grid,
  .app-search-bar,
  .app-channel-grid,
  .app-user-channel-grid,
  .app-secrets-grid,
  .app-restaurants-grid,
  .app-restaurant-summary-grid,
  .app-situation-grid,
  .app-panel-grid-wide,
  .app-panel-grid-analytics,
  .app-master-detail {
    grid-template-columns: 1fr;
  }

  .app-rule-item {
    grid-template-columns: 1fr;
  }

  .app-category-event-item,
  .app-user-channel-row {
    grid-template-columns: 1fr;
  }

  .app-rule-item-meta {
    justify-content: flex-start;
  }

  .app-category-event-actions {
    justify-content: flex-start;
  }

  .app-desktop-only {
    display: none;
  }

  .app-mobile-only {
    display: block;
  }

  .app-public-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-timeline-bars {
    min-height: 140px;
  }
}

@media (max-width: 430px) {
  .app-page-title {
    font-size: 30px;
  }

  .app-card-header,
  .app-card-body,
  .app-drawer-header,
  .app-drawer-body,
  .app-dialog {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-toast-stack {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }

  .app-toast {
    min-width: 0;
    max-width: none;
  }

  .app-user-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .app-brand-mark-public {
    width: 84px;
    height: 84px;
  }

  .app-brand-mark-public img {
    width: 56px;
    height: 56px;
  }

  .app-brand-mark {
    width: 64px;
    height: 64px;
  }

  .app-brand-mark img {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 390px) {
  .app-button,
  .app-icon-button,
  .app-tab {
    width: 100%;
  }

  .app-action-row,
  .app-form-actions,
  .app-inline-actions,
  .app-page-actions,
  .app-dialog-actions {
    flex-direction: column;
  }
}
