:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #65726f;
  --line: #d9e2dc;
  --paper: #f7faf7;
  --panel: #ffffff;
  --green: #23745b;
  --green-dark: #155441;
  --gold: #b7791f;
  --red: #b13a3a;
  --blue: #315f9f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 42, 37, 0.96);
}

.access-gate[hidden] {
  display: none;
}

.access-box {
  width: min(420px, 100%);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
}

.access-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  margin: 12px 0;
}

.access-box button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  background: #102a25;
  color: #f8fffb;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow,
.sidebar .muted {
  color: #aac9be;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.6rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.metric-stack {
  display: grid;
  gap: 12px;
}

.metric {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.metric span {
  display: block;
  font-size: 2rem;
  font-weight: 800;
}

.metric small {
  color: #c3d9d1;
}

.primary-button,
.quick-capture button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover,
.quick-capture button:hover {
  background: var(--green-dark);
}

.workspace {
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e4f3ea;
  color: var(--green-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.status-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill[data-state="offline"] {
  background: #fae8e8;
  color: var(--red);
}

.status-pill[data-state="online"] {
  background: #e4f3ea;
  color: var(--green-dark);
}

.quick-capture {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 130px 140px 120px;
  gap: 10px;
}

.client-editor {
  display: grid;
  grid-template-columns: 180px 220px minmax(220px, 1fr) 150px;
  gap: 10px;
}

.skillbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skillbar button,
.help-link,
.import-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.skillbar button:hover,
.help-link:hover,
.import-button:hover {
  border-color: var(--green);
  background: #edf4ef;
}

.import-button input {
  display: none;
}

.quick-capture input,
.quick-capture select,
.client-editor input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.client-editor button,
.panel-tools button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
}

.client-editor button:hover,
.panel-tools button:hover {
  border-color: var(--green);
  background: #edf4ef;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.panel,
.roadmap,
.ops-panel,
.birth-record {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel {
  min-height: 360px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header span {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  border-radius: 999px;
  background: #edf4ef;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.panel-tools {
  padding: 10px 12px 0;
}

.item-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 11px;
  background: #fbfdfb;
}

.item[data-impact="alto"] {
  border-left-color: var(--red);
}

.item[data-impact="medio"] {
  border-left-color: var(--gold);
}

.item[data-impact="bajo"] {
  border-left-color: var(--blue);
}

.item p {
  margin: 0;
  line-height: 1.35;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--green);
}

.roadmap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.roadmap ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.roadmap li {
  line-height: 1.4;
}

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

.ops-panel {
  min-height: 260px;
}

.report-list,
.event-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.report-card,
.event-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.report-card h4,
.event-card h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.report-card p,
.event-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.event-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.birth-record {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 18px;
  padding: 20px;
}

.birth-intro p {
  margin-bottom: 0;
}

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

.fact {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfb;
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fact strong {
  display: block;
  margin-top: 5px;
  line-height: 1.3;
}

.birth-record ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.birth-record li {
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .metric-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .board,
  .ops-grid,
  .birth-record {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .sidebar,
  .topbar,
  .quick-capture,
  .client-editor,
  .board,
  .roadmap,
  .metric-stack {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .status-group {
    justify-content: flex-start;
  }

  .birth-record,
  .ops-grid,
  .fact-grid {
    grid-template-columns: 1fr;
  }
}
