*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bi-white: #ffffff;
  --bi-ink: #1a1d26;
  --bi-blue: #2563eb;
  --bi-coral: #f97362;
  --bi-gray: #f0f2f5;
}

body.bi-body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bi-gray);
  color: var(--bi-ink);
  line-height: 1.55;
  font-size: 0.92rem;
}

h1, h2, h3 { font-family: 'Inter Tight', sans-serif; }

.bi-dashboard {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 80vh;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bi-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.bi-rail {
  background: var(--bi-ink);
  color: #fff;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
}

.bi-rail__logo {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0 0.5rem 1rem;
  border-bottom: 1px solid #333;
  margin-bottom: 1rem;
}

.bi-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.bi-rail__btn {
  background: transparent;
  border: none;
  color: #aaa;
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
}

.bi-rail__btn:hover { background: #2a2f3a; color: #fff; }
.bi-rail__btn.is-active { background: var(--bi-blue); color: #fff; }

.bi-rail__meta {
  font-size: 0.75rem;
  color: #888;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

.bi-rail__meta a { color: var(--bi-coral); text-decoration: none; }

.bi-workspace { padding: 1.5rem; overflow: hidden; }

.bi-topbar {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.bi-topbar__title { font-size: 1.35rem; font-weight: 700; }
.bi-topbar__subtitle { font-size: 0.85rem; color: #6b7280; margin-top: 0.15rem; }

.bi-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.bi-kpi {
  background: var(--bi-gray);
  border-radius: 8px;
  padding: 0.85rem;
  border: 1px solid #e5e7eb;
}

.bi-kpi__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.bi-kpi__value {
  display: block;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin: 0.25rem 0 0.5rem;
}

.bi-sparkline {
  height: 24px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.bi-sparkline--up {
  background-image: linear-gradient(to right, transparent 0%, transparent 10%, var(--bi-blue) 10%, var(--bi-blue) 12%, transparent 12%, transparent 22%, var(--bi-blue) 22%, var(--bi-blue) 28%, transparent 28%, transparent 38%, var(--bi-blue) 38%, var(--bi-blue) 35%, transparent 35%, transparent 50%, var(--bi-blue) 50%, var(--bi-blue) 58%, transparent 58%, transparent 68%, var(--bi-blue) 68%, var(--bi-blue) 75%, transparent 75%, transparent 85%, var(--bi-blue) 85%, var(--bi-blue) 95%, transparent 95%);
  clip-path: polygon(0 100%, 10% 70%, 22% 80%, 38% 45%, 50% 55%, 68% 25%, 85% 35%, 100% 10%, 100% 100%);
  background-color: rgba(37, 99, 235, 0.15);
}

.bi-sparkline--flat {
  background-image: linear-gradient(to right, var(--bi-blue) 0%, var(--bi-blue) 100%);
  clip-path: polygon(0 60%, 25% 58%, 50% 62%, 75% 57%, 100% 60%, 100% 100%, 0 100%);
  background-color: rgba(37, 99, 235, 0.12);
  opacity: 0.7;
}

.bi-sparkline--down {
  background-color: rgba(249, 115, 98, 0.15);
  clip-path: polygon(0 20%, 20% 35%, 40% 30%, 60% 50%, 80% 45%, 100% 70%, 100% 100%, 0 100%);
}

.bi-intro {
  font-size: 0.88rem;
  color: #4b5563;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-left: 3px solid var(--bi-coral);
}

.bi-cards__heading {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.bi-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.bi-card {
  background: var(--bi-white);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: opacity 0.2s, transform 0.2s;
}

.bi-card.is-hidden { opacity: 0.3; transform: scale(0.98); pointer-events: none; }

.bi-card__spark { margin-bottom: 0.5rem; }

.bi-card h3 { font-size: 0.95rem; margin-bottom: 0.35rem; }
.bi-card p { font-size: 0.82rem; color: #6b7280; margin-bottom: 0.5rem; }

.bi-card__tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bi-gray);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  color: var(--bi-blue);
}

.bi-contact-panel {
  background: var(--bi-gray);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid #e5e7eb;
}

.bi-contact-panel h2 { font-size: 1rem; margin-bottom: 0.5rem; }

.bi-contact-panel__addr {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.bi-contact-panel a { color: var(--bi-blue); }

.bi-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.bi-form__field { margin-bottom: 0.65rem; }

.bi-form__field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.bi-form__field input,
.bi-form__field textarea {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.88rem;
}

.bi-form__field--check {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
}

.bi-form__field--check input { width: auto; }
.bi-form__field--check label { flex: 1; font-weight: 400; }

.bi-form__error { display: block; color: var(--bi-coral); font-size: 0.75rem; min-height: 0.9rem; }

.bi-form__submit {
  background: var(--bi-blue);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter Tight', sans-serif;
}

.bi-form__submit:hover { background: #1d4ed8; }

.bi-form__success {
  margin-top: 0.65rem;
  padding: 0.5rem;
  background: #dcfce7;
  color: #166534;
  border-radius: 4px;
  font-size: 0.85rem;
}

.bi-legal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem 5%;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.82rem;
}

.bi-legal h2 { font-size: 0.9rem; margin-bottom: 0.4rem; }

.bi-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.bi-footer nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.bi-footer a { color: var(--bi-blue); text-decoration: none; }

@media (max-width: 768px) {
  .bi-dashboard { grid-template-columns: 1fr; }
  .bi-rail { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
  .bi-rail__nav { flex-direction: row; flex-wrap: wrap; flex: none; }
  .bi-rail__meta { border: none; padding: 0; }
  .bi-kpi-row { grid-template-columns: 1fr; }
  .bi-cards { grid-template-columns: 1fr; }
  .bi-form__row { grid-template-columns: 1fr; }
  .bi-legal { grid-template-columns: 1fr; }
}
