/* The panel's own styling, on top of Bootstrap.
   Desktop-first: the sidebar is fixed on a wide screen and becomes an
   off-canvas drawer below 992px, where Bootstrap's own breakpoint is. */

:root {
  --et-sidebar: 232px;
  --et-ink: #101828;
  --et-muted: #667085;
  --et-line: #e4e7ec;
  --et-surface: #f7f8fa;
  --et-accent: #2f6fed;
}

body {
  background: var(--et-surface);
  color: var(--et-ink);
  font-size: 0.95rem;
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--et-sidebar);
  flex: 0 0 var(--et-sidebar);
  background: #fff;
  border-right: 1px solid var(--et-line);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0.5rem 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--et-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.brand-mark-lg { width: 48px; height: 48px; font-size: 1.1rem; border-radius: 12px; }
.brand-text { font-weight: 600; }

.sidebar .nav-link {
  color: var(--et-ink);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  margin-bottom: 0.15rem;
}

.sidebar .nav-link:hover { background: var(--et-surface); }
.sidebar .nav-link.active { background: var(--et-accent); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 0.5rem; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--et-line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.page-title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.account { color: var(--et-muted); text-decoration: none; font-size: 0.9rem; }
.account:hover { color: var(--et-accent); }

.content { padding: 1.5rem; max-width: 1500px; width: 100%; }

.card { border-color: var(--et-line); }
.card-header { background: #fff; font-weight: 600; border-bottom-color: var(--et-line); }

.stat-card .stat-label { color: var(--et-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 650; line-height: 1.2; margin-top: 0.25rem; }
.stat-card .stat-hint { color: var(--et-muted); font-size: 0.8rem; margin-top: 0.35rem; }
.stat-accent { border-color: var(--et-accent); }
.stat-accent .stat-value { color: var(--et-accent); }

.chart-box { position: relative; height: 260px; }

.funnel .funnel-step { margin-bottom: 0.85rem; }
.funnel .progress { height: 8px; margin-top: 0.3rem; }

.plan-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 0.35rem; }
.plan-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
}

.trace {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  max-height: 420px;
  overflow: auto;
  margin: 0;
}

.error-message { max-width: 22rem; }

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--et-surface);
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--et-line);
  border-radius: 14px;
  padding: 2rem;
}

.htmx-indicator { opacity: 0; transition: opacity 120ms; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .content { padding: 1rem; }
  .plan-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
