:root {
  --app-bg: #eef3f9;
  --app-surface: rgba(255, 255, 255, 0.92);
  --app-surface-strong: #ffffff;
  --app-border: #d7e2ef;
  --app-border-strong: #c4d4e7;
  --app-text: #18314a;
  --app-muted: #5d738f;
  --app-primary: #2f76e8;
  --app-primary-strong: #1f5ed9;
  --app-accent: #19a3ff;
  --app-success: #1ea672;
  --app-warning: #c9851b;
  --app-danger: #d14c61;
  --app-shadow: 0 18px 42px rgba(18, 48, 88, 0.08);
  --app-radius-lg: 18px;
  --app-radius-md: 14px;
  --app-radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(47, 118, 232, 0.08), transparent 20%),
    radial-gradient(circle at top right, rgba(25, 163, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #f5f8fc 0%, #eef3f9 100%);
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin-bottom: 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.98));
  border: 1px solid #d7dfeb;
  border-radius: 14px;
  box-shadow: 0 8px 16px rgba(31, 45, 61, 0.08);
}

.topbar-inner {
  width: min(1880px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 170, 67, 0.35);
  background: linear-gradient(145deg, rgba(214, 170, 67, 0.16), rgba(90, 143, 255, 0.1));
  font-size: 0.94rem;
}

.brand strong {
  display: block;
  font-size: 1.06rem;
  line-height: 1;
}

.brand small {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.78;
  margin-top: 2px;
  line-height: 1;
}

.menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.menu a {
  color: #355066;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(84, 112, 140, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.92));
  box-shadow: 0 6px 14px rgba(31, 45, 61, 0.05);
  transition: all 0.22s ease;
}

.menu a span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 900;
  border: 1px solid rgba(84, 112, 140, 0.22);
  background: linear-gradient(180deg, rgba(84, 112, 140, 0.16), rgba(84, 112, 140, 0.06));
}

.menu a:hover {
  color: #22405f;
  background: rgba(90, 143, 255, 0.12);
  transform: translateY(-1px);
}

.menu a.active {
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #16a3ff);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(90, 143, 255, 0.28);
}

.menu a.active span {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid #d7dfeb;
  color: #355066;
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.98));
}

.app-page {
  width: min(1440px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

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

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  color: var(--app-muted);
  font-size: 0.82rem;
}

.breadcrumbs__link {
  color: #25579c;
  text-decoration: none;
}

.breadcrumbs__current {
  font-weight: 700;
  color: var(--app-text);
}

.breadcrumbs__sep {
  opacity: 0.5;
}

.flash-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--app-radius-md);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  margin-bottom: 14px;
}

.flash-message.is-success {
  border-color: rgba(30, 166, 114, 0.25);
}

.flash-message.is-error {
  border-color: rgba(209, 76, 97, 0.25);
}

.flash-message.is-warning {
  border-color: rgba(201, 133, 27, 0.25);
}

.flash-message.is-info {
  border-color: rgba(47, 118, 232, 0.25);
}

.flash-message__close,
.app-modal__close {
  border: 0;
  background: transparent;
  color: var(--app-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.app-modal[hidden] {
  display: none;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 19, 34, 0.55);
  backdrop-filter: blur(8px);
}

.app-modal__dialog {
  width: min(560px, 100%);
  background: var(--app-surface-strong);
  border-radius: var(--app-radius-lg);
  border: 1px solid var(--app-border);
  padding: 18px;
  box-shadow: 0 28px 60px rgba(18, 48, 88, 0.2);
}

.app-modal__content {
  color: var(--app-muted);
  line-height: 1.7;
}

@media (max-width: 960px) {
  .topbar-inner {
    flex-wrap: wrap;
  }

  .topbar-actions {
    margin-left: auto;
  }
}
