* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at top left, rgba(9, 26, 71, 0.1), transparent 30%), linear-gradient(180deg, #fcfdff 0%, #eef3fb 100%);
  color: #0c1733;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

.page {
  min-height: 100vh;
}

.app-shell {
  width: min(1440px, 100% - 40px);
  margin: 20px auto 40px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: 0 18px 45px rgba(20, 65, 51, 0.08);
  padding: 24px;
  backdrop-filter: blur(16px);
}

.panel-head,
.topbar,
.upload-meta,
.table-row,
.feature-row {
  display: flex;
  gap: 16px;
}

.panel-head {
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.panel h2,
.panel h3,
.panel h1 {
  margin: 0;
}

.panel-subtitle,
.helper,
.footer-note,
.table-row span,
.feature-row span {
  color: #60708f;
  line-height: 1.6;
}

.eyebrow {
  display: inline-flex;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: #04102d;
  margin-bottom: 12px;
}

.button,
.button-secondary,
.button-outline,
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.button {
  background: linear-gradient(135deg, #091A47 0%, #04102d 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(9, 26, 71, 0.25);
}

.button-secondary,
.button-outline,
.nav-link {
  background: #ffffff;
  color: #0c1733;
  border: 1px solid rgba(9, 26, 71, 0.12);
}

.button-block {
  width: 100%;
}

.tag,
.chip,
.hero-chip,
.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(9, 26, 71, 0.12);
  background: #e8edf8;
  color: #04102d;
  font-size: 0.9rem;
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1100;
  pointer-events: none;
}

.flash {
  padding: 14px 18px;
  border-radius: 20px;
  font-weight: 700;
}

.flash-toast {
  min-width: min(420px, 100vw - 32px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 12px;
  border: 1px solid rgba(19, 53, 42, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 44px rgba(19, 53, 42, 0.16);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-14px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.flash-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.flash-toast.is-leaving {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
}

.flash-indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.flash-message {
  flex: 1 1 auto;
  line-height: 1.45;
}

.flash-close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px;
  opacity: 0.65;
}

.flash-close:hover {
  opacity: 1;
}

.flash-success {
  color: #0f7f46;
}

.flash-success .flash-indicator {
  background: #091A47;
  box-shadow: 0 0 0 6px rgba(9, 26, 71, 0.12);
}

.flash-error {
  color: #a33131;
}

.flash-error .flash-indicator {
  background: #d64545;
  box-shadow: 0 0 0 6px rgba(214, 69, 69, 0.12);
}

.field-label {
  font-weight: 700;
  color: #0c1733;
}

.text-input {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(9, 26, 71, 0.12);
  background: #fff;
  color: #0c1733;
  padding: 12px 14px;
  font: inherit;
}

.text-area {
  min-height: 130px;
  resize: vertical;
}

.upload-form,
.upload-input,
.table-grid,
.feature-grid,
.admin-table,
.admin-form {
  display: grid;
  gap: 16px;
}

.upload-input input[type=file] {
  display: none;
}

.file-drop {
  border: 1px dashed rgba(9, 26, 71, 0.35);
  background: #f8fdf9;
  border-radius: 18px;
  padding: 28px 22px;
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.section {
  margin-top: 22px;
}

.table-row,
.feature-row {
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 16px;
  background: #f1f4fb;
  border: 1px solid rgba(19, 53, 42, 0.06);
}

.table-row strong,
.feature-row strong {
  display: block;
}

.numbers {
  text-align: right;
}

.chart-wrap {
  min-height: 260px;
}

.chart-wrap svg {
  width: 100%;
  height: 260px;
  display: block;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #091A47 0%, #1767ff 100%);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #60708f;
}

.brand small em {
  font-style: normal;
  color: #04102d;
  font-weight: 700;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #091A47 0%, #1767ff 100%);
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  min-height: 56px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(13, 92, 99, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(243, 250, 247, 0.88)), radial-gradient(circle at 8% 0%, rgba(9, 26, 71, 0.16), transparent 38%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: #0c1733;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.user-menu__trigger:hover,
.user-menu.is-open .user-menu__trigger {
  border-color: rgba(9, 26, 71, 0.24);
  transform: translateY(-1px);
}

.user-menu__identity {
  display: grid;
  gap: 2px;
}

.user-menu__identity strong,
.user-menu__identity small {
  display: block;
}

.user-menu__identity small {
  color: #60708f;
}

.user-menu__caret {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(13, 92, 99, 0.08);
  color: #31565b;
  font-size: 0.82rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.user-menu.is-open .user-menu__caret {
  background: rgba(9, 26, 71, 0.16);
  transform: rotate(180deg);
}

.user-menu__dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 292px;
  padding: 12px;
  border-radius: 26px;
  border: 1px solid rgba(13, 92, 99, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 249, 0.96)), radial-gradient(circle at top right, rgba(9, 26, 71, 0.16), transparent 38%);
  box-shadow: 0 28px 70px rgba(13, 92, 99, 0.2);
  backdrop-filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 1200;
}

.user-menu__card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 20px;
  background: radial-gradient(circle at top right, rgba(9, 26, 71, 0.18), transparent 42%), linear-gradient(135deg, rgba(245, 252, 248, 0.98) 0%, rgba(232, 246, 239, 0.98) 100%);
  border: 1px solid rgba(13, 92, 99, 0.08);
}

.user-menu__card-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #091A47 0%, #1767ff 100%);
  color: #fff;
  font-weight: 800;
}

.user-menu__card-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-menu__card-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-menu__card-text strong,
.user-menu__card-text small {
  display: block;
}

.user-menu__card-text strong {
  font-size: 0.96rem;
}

.user-menu__card-text small {
  color: #60708f;
  overflow-wrap: anywhere;
}

.user-menu.is-open .user-menu__dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.user-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 16px;
  color: #0c1733;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.user-menu__item .material-symbols-outlined {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(13, 92, 99, 0.07);
  color: #1767ff;
  font-size: 1.05rem;
}

.user-menu__item:hover {
  background: rgba(9, 26, 71, 0.1);
  color: #1767ff;
  transform: translateX(2px);
}

.user-menu__item--danger {
  color: #a33131;
  margin-top: 8px;
  border-top: 1px solid rgba(163, 49, 49, 0.1);
  border-radius: 0 0 16px 16px;
}

.user-menu__item--danger .material-symbols-outlined {
  background: rgba(163, 49, 49, 0.08);
  color: #a33131;
}

.user-menu__item--danger:hover {
  background: rgba(163, 49, 49, 0.08);
  color: #8f2525;
}

@media (max-width: 960px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
  }
  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }
  .flash-toast {
    min-width: 100%;
  }
  .topbar,
  .upload-meta,
  .table-row,
  .feature-row,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .numbers {
    text-align: left;
  }
  .user-menu,
  .user-menu__trigger {
    width: 100%;
  }
  .user-menu__dropdown {
    left: 0;
    right: 0;
    min-width: 0;
  }
}
