:root {
  --bg: #eef5ff;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #617085;
  --line: #d5e1f0;
  --accent: #285ea8;
  --accent-2: #7c6dfd;
  --danger: #b42318;
  --ok: #087443;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Open Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(124, 109, 253, 0.16), transparent 28%),
    linear-gradient(135deg, #f9fcff, var(--bg));
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  display: block;
  width: 142px;
  height: auto;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}

.brand-title {
  letter-spacing: -0.01em;
  white-space: nowrap;
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px;
}

.hero {
  margin-bottom: 22px;
}

.hero h1,
.card h1,
.card h2 {
  margin-top: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-header h2 {
  margin-bottom: 0;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.card {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 36px rgba(40, 94, 168, 0.09);
}

.narrow {
  max-width: 440px;
  margin: 60px auto;
}

.stack {
  display: grid;
  gap: 14px;
}

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

.inline-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}

.field-label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: white;
}

input[type="checkbox"] {
  width: auto;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  font: inherit;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--accent-2), #5f9dff);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button.secondary {
  color: var(--ink);
  background: #eef4ff;
}

.link-button {
  padding: 0;
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.danger-link {
  padding: 0;
  color: var(--danger);
  background: transparent;
  box-shadow: none;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.secondary-action {
  color: var(--ink);
  background: #eef4ff;
}

.table-action-form {
  margin: 0;
}

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

.form-help {
  margin: -4px 0 0 0;
  font-size: 13px;
}

.report-picker {
  position: relative;
}

.block-picker {
  position: relative;
}

.report-picker-button {
  position: relative;
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 11px 42px 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  box-shadow: none;
  text-align: left;
}

.report-picker-button::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.report-picker-main,
.report-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-picker-title,
.report-option-title {
  font-weight: 800;
}

.report-picker-description,
.report-option-description {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.recommended-badge {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #253058;
  background: rgba(124, 109, 253, 0.13);
  font-size: 11px;
  font-weight: 800;
}

.report-picker-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 330px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(40, 94, 168, 0.18);
}

.report-picker.is-open .report-picker-menu {
  display: grid;
  gap: 4px;
}

.block-picker.is-open .report-picker-menu {
  display: grid;
  gap: 6px;
}

.block-picker-search {
  position: sticky;
  z-index: 1;
  top: 0;
  margin-bottom: 2px;
  background: white;
}

.block-picker-options {
  display: grid;
  gap: 4px;
}

.report-picker-option {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.report-picker-option:hover,
.report-picker-option:focus,
.report-picker-option[aria-selected="true"] {
  background: #eef4ff;
  outline: none;
}

.info-box {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid rgba(124, 109, 253, 0.24);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(124, 109, 253, 0.07);
  font-size: 13px;
  line-height: 1.55;
}

.info-box p {
  margin: 0;
}

.info-box strong {
  color: var(--ink);
}

.empty-state {
  padding: 13px 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(238, 244, 255, 0.7);
  font-size: 13px;
  line-height: 1.5;
}

.is-hidden {
  display: none !important;
}

.alert,
.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
}

.alert {
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.24);
  background: rgba(255, 231, 230, 0.88);
}

.notice {
  color: var(--ok);
  border: 1px solid rgba(8, 116, 67, 0.20);
  background: rgba(232, 248, 240, 0.9);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--accent);
  font-weight: 800;
}

pre {
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: #f5f8fc;
}

@media (max-width: 860px) {
  .grid,
  .two-col {
    grid-template-columns: 1fr;
  }

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

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