:root {
  --ink: #1a2b3c;
  --ink-soft: #314657;
  --steel: #2f6f8f;
  --paper: #f3f5f7;
  --line: #e1e6eb;
  --good: #1e7a46;
  --good-bg: #e7f5ec;
  --watch: #8a6408;
  --watch-bg: #fbf3dc;
  --off: #9d2c2c;
  --off-bg: #fdecec;
  --sidebar: 268px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--ink);
  color: #e7eef3;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 1.25rem 0.9rem 2rem;
}

.wordmark {
  display: block;
  text-decoration: none;
  color: #fff;
  padding: 0.2rem 0.7rem 1rem;
}

.wordmark-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 9rem;
  margin-bottom: 0.35rem;
  object-fit: contain;
}
.trend-up { color: #1f7a4d; }
.trend-down { color: #9b2c2c; }
.trend-flat { color: #667085; }

.wordmark-name {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.wordmark-product {
  display: block;
  margin-top: 0.2rem;
  color: #b7c6d2;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-section {
  margin: 1rem 0.7rem 0.35rem;
  color: #8ea3b3;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-link {
  display: block;
  color: #d5e0e8;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  margin-bottom: 0.1rem;
  font-size: 0.92rem;
}

.side-link:hover,
.side-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side-link.active {
  box-shadow: inset 3px 0 0 var(--steel);
}

.content {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.page {
  padding: 1.25rem 1.5rem 3rem;
}

.who {
  text-align: right;
}

.who strong {
  display: block;
}

.who span {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.hero-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.8rem;
}

.hero-card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.05rem;
}

.hero-card .label,
.muted {
  color: #5d7182;
  font-size: 0.82rem;
}

.hero-card .value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1.15;
  margin: 0.2rem 0;
}

.delta {
  font-size: 0.86rem;
}

.delta.up { color: var(--good); }
.delta.down { color: var(--off); }

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.status-good { background: var(--good-bg); color: var(--good); }
.status-watch { background: var(--watch-bg); color: var(--watch); }
.status-off { background: var(--off-bg); color: var(--off); }
.status-neutral { background: #eef2f5; color: #526575; }

.rock-track {
  height: 8px;
  background: #e6ebf0;
  border-radius: 99px;
  overflow: hidden;
}

.rock-fill {
  height: 100%;
  background: var(--steel);
}

.rock-fill.off {
  background: var(--off);
}

.section-title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    linear-gradient(180deg, rgba(26, 43, 60, 0.04), transparent 28%),
    var(--paper);
}

.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
}

.btn-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-ink:hover {
  background: #24384c;
  color: #fff;
}

.chart-box {
  height: 260px;
}

table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.form-section {
  background: #f8fafb;
  border: 1px dashed #cfd8e0;
  border-radius: 12px;
  padding: 0.9rem;
}

@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .hero-grid, .stat-grid { grid-template-columns: 1fr 1fr; }
  .page, .topbar { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 575.98px) {
  .hero-grid, .stat-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}

.kpi-section:not(.is-showing-inactive) tr.kpi-inactive {
  display: none;
}

.meeting-timer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  min-width: 4.2rem;
}

.meeting-timer.is-timer-done .timer-display {
  color: var(--off);
}

.org-chart {
  overflow-x: auto;
  padding: 0.25rem 0 0.5rem;
}

.org-tree,
.org-tree ul {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.org-tree ul {
  position: relative;
  padding-top: 1.4rem;
}

.org-tree li {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 1.4rem 0.55rem 0;
  list-style: none;
}

.org-tree > li,
.org-tree li:only-child {
  padding-top: 0;
}

.org-node {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  min-width: 8.5rem;
  max-width: 14rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.org-node strong,
.org-node span {
  display: block;
}

.org-node span {
  color: #5d7182;
  font-size: 0.82rem;
}

.org-node.is-loop {
  border-style: dashed;
}

.org-tree li::before,
.org-tree li::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 1.4rem;
  border-top: 1px solid #b7c3ce;
}

.org-tree li::before {
  right: 50%;
}

.org-tree li::after {
  left: 50%;
  border-left: 1px solid #b7c3ce;
}

.org-tree li:first-child::before,
.org-tree li:last-child::after,
.org-tree li:only-child::before,
.org-tree li:only-child::after,
.org-tree > li::before,
.org-tree > li::after {
  display: none;
  border: 0;
}

.org-tree li:last-child::before {
  display: block;
  border-top: 1px solid #b7c3ce;
  border-right: 1px solid #b7c3ce;
}

.org-tree li:only-child::before,
.org-tree > li::before,
.org-tree > li::after,
.org-tree > li:last-child::before {
  display: none;
}

.org-tree ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 1px solid #b7c3ce;
  height: 1.4rem;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.cal-day { min-height: 4.5rem; }
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.swot-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  min-height: 12rem;
}

.swot-strength { background: var(--good-bg); }
.swot-weakness { background: var(--off-bg); }
.swot-opportunity { background: #e8f2f7; }
.swot-threat { background: var(--watch-bg); }

@media (max-width: 767.98px) {
  .swot-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .no-print, tr.kpi-inactive { display: none !important; }
  .app-shell { display: block; }
  .page { padding: 0; }
  body { background: #fff; }
}
