/* Certified Spaces — Command Center */
:root {
  --pine: #3F5A39; --moss: #56683F; --sage: #6F8159; --soft-sage: #7D9163;
  --warm-white: #F7F6F0; --linen: #F1ECE0; --pale-sage: #E8EFE1; --stone: #DCDCD2;
  --charcoal: #333; --warm-gray: #8A8A80; --brass: #9C7A3C; --lime: #C7F04A;
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 14.5px; color: var(--charcoal); background: var(--warm-white); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--pine); }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; width: 100%; padding: 0.55rem 0.75rem;
  border: 1px solid var(--stone); border-radius: 9px; background: #fff; color: var(--charcoal);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--pale-sage); }
label { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sage); margin-bottom: 0.9rem; }
label input, label select, label textarea { margin-top: 0.3rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.btn {
  background: var(--pine); color: var(--warm-white); border: 0; border-radius: 999px;
  padding: 0.6rem 1.4rem; font-weight: 600; font-size: 0.85rem;
}
.btn:hover { background: var(--moss); }
.btn--ghost { background: transparent; color: var(--pine); border: 1px solid var(--stone); }
.btn--ghost:hover { background: var(--pale-sage); }
.btn--small { padding: 0.35rem 0.9rem; font-size: 0.75rem; }
.muted { color: var(--warm-gray); }
.err { color: #a33; font-size: 0.85rem; margin-top: 0.6rem; }

/* login gate */
.gate { position: fixed; inset: 0; display: grid; place-items: center; background: var(--warm-white); z-index: 50; }
.gate[hidden] { display: none; }
.gate__card { width: min(360px, 90vw); background: #fff; border: 1px solid var(--stone); border-radius: 18px; padding: 2.2rem; }
.gate__card h1 { font-size: 1.6rem; }
.gate__card .muted { margin: 0.2rem 0 1.4rem; font-size: 0.85rem; }
.gate__card .btn { width: 100%; margin-top: 0.4rem; }

/* layout */
#app { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side { background: var(--pine); color: var(--warm-white); padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; position: sticky; top: 0; height: 100vh; }
.side__brand { font-family: var(--serif); font-size: 1.5rem; color: var(--lime); margin-bottom: 1.2rem; }
.side__brand small { display: block; font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(247,246,240,0.6); }
.side nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.side__tab {
  text-align: left; background: transparent; border: 0; color: rgba(247,246,240,0.78);
  padding: 0.6rem 0.8rem; border-radius: 9px; font-size: 0.9rem;
}
.side__tab:hover { background: rgba(247,246,240,0.08); }
.side__tab.active { background: rgba(199,240,74,0.14); color: var(--lime); font-weight: 600; }
.side__site { color: rgba(247,246,240,0.6); font-size: 0.75rem; text-decoration: none; padding: 0.6rem 0.8rem; }
.side__site:hover { color: var(--lime); }
.main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem); }
.banner { background: var(--pale-sage); border: 1px solid var(--soft-sage); color: var(--pine); border-radius: 10px; padding: 0.7rem 1rem; font-size: 0.85rem; margin-bottom: 1.2rem; }

.view-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.view-head h2 { font-size: 1.7rem; }

/* pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 0.9rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.col { background: var(--linen); border-radius: 14px; padding: 0.8rem; }
.col h3 { font-size: 0.78rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage); display: flex; justify-content: space-between; margin-bottom: 0.7rem; }
.cardlet { background: #fff; border: 1px solid var(--stone); border-radius: 11px; padding: 0.8rem 0.9rem; margin-bottom: 0.6rem; }
.cardlet strong { display: block; color: var(--pine); }
.cardlet .meta { font-size: 0.75rem; color: var(--warm-gray); margin: 0.15rem 0 0.5rem; }
.cardlet select { padding: 0.3rem 0.5rem; font-size: 0.75rem; width: auto; }
.cardlet .row { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* tables */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--stone); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--linen); font-size: 0.85rem; vertical-align: top; }
th { background: var(--linen); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sage); }
tr:hover td { background: #fbfaf6; }
.pill { display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.22rem 0.6rem; border-radius: 999px; background: var(--pale-sage); color: var(--pine); }
.pill--brass { background: #f3e8d3; color: var(--brass); }
.pill--gray { background: var(--linen); color: var(--warm-gray); }

/* forms + modal */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.modal { position: fixed; inset: 0; background: rgba(20, 26, 18, 0.45); display: grid; place-items: center; z-index: 40; padding: 1rem; }
.modal__card { background: var(--warm-white); border-radius: 16px; padding: 1.8rem; width: min(640px, 96vw); max-height: 92vh; overflow-y: auto; }
.modal__card h3 { margin-bottom: 1.2rem; font-size: 1.3rem; }
.modal__actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.4rem; }

/* blueprint */
.blueprint { background: #fff; border: 1px solid var(--stone); border-radius: 14px; padding: 2rem; max-width: 860px; }
.blueprint h2 { font-size: 1.6rem; }
.bp-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--pine); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.bp-meta { font-size: 0.82rem; color: var(--warm-gray); text-align: right; }
.bp-sys { display: grid; grid-template-columns: 30px 1fr; gap: 0.8rem; padding: 0.9rem 0; border-bottom: 1px solid var(--linen); }
.bp-sys .n { font-family: var(--serif); color: var(--brass); }
.bp-sys h4 { color: var(--pine); font-size: 0.95rem; }
.bp-sys p { font-size: 0.82rem; color: var(--warm-gray); margin-top: 0.15rem; }
.bp-sys .flag { font-size: 0.8rem; color: var(--pine); background: var(--pale-sage); border-radius: 8px; padding: 0.4rem 0.6rem; margin-top: 0.45rem; }
.bp-summary { background: var(--linen); border-radius: 12px; padding: 1rem 1.2rem; margin: 1.2rem 0; font-size: 0.9rem; }
.bp-summary strong { color: var(--pine); }

/* settings */
.setcard { background: #fff; border: 1px solid var(--stone); border-radius: 14px; padding: 1.4rem; margin-bottom: 1rem; max-width: 720px; }
.setcard h3 { margin-bottom: 0.6rem; }
.setcard code { background: var(--linen); padding: 0.1rem 0.4rem; border-radius: 5px; font-size: 0.82rem; }

@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .side nav { flex-direction: row; }
  .side__brand small { display: none; }
}
@media print {
  .side, .banner, .view-head .btn, .no-print { display: none !important; }
  #app { grid-template-columns: 1fr; }
  .blueprint { border: 0; padding: 0; }
}
