:root {
  --bg: #f3f0e9;
  --surface: #fbf9f4;
  --surface-2: #e9e4d9;

  --ink: #1f211d;
  --muted: #6b6d65;

  --sidebar: #171a16;
  --sidebar-soft: #222720;

  --olive: #59634f;
  --olive-soft: #dfe4da;

  --amber: #b88943;
  --red: #9c4f45;
  --red-soft: #f0dfdc;

  --line: rgba(31, 33, 29, 0.13);
  --line-dark: rgba(255, 255, 255, 0.11);

  --serif: "Playfair Display", Georgia, serif;
  --sans: "Manrope", Arial, sans-serif;
  --ui: "DM Sans", Arial, sans-serif;

  --sidebar-width: 245px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  background: var(--bg);
  color: var(--ink);

  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--olive);
  color: white;
}


/* -------------------------------------------------------
   SIDEBAR
------------------------------------------------------- */

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;

  position: fixed;
  inset: 0 auto 0 0;

  z-index: 30;

  padding: 26px 20px;

  display: flex;
  flex-direction: column;

  background: var(--sidebar);
  color: white;

  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.ops-brand {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 0 8px 24px;

  border-bottom: 1px solid var(--line-dark);
}

.brand-mark {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255, 255, 255, 0.28);

  font: 500 1.05rem var(--serif);
}

.ops-brand > span:last-child {
  display: flex;
  flex-direction: column;
}

.ops-brand strong {
  font: 700 0.7rem var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ops-brand small {
  margin-top: 5px;

  font: 500 0.56rem var(--ui);
  letter-spacing: 0.11em;
  text-transform: uppercase;

  color: rgba(255, 255, 255, 0.42);
}

.ops-nav {
  margin-top: 28px;

  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;

  min-height: 43px;
  padding: 0 12px;

  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;

  border: 0;

  background: transparent;
  color: rgba(255, 255, 255, 0.54);

  text-align: left;

  font: 600 0.66rem var(--ui);
  letter-spacing: 0.04em;

  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.nav-item span {
  font-size: 0.52rem;

  color: rgba(255, 255, 255, 0.28);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: white;
}

.nav-item.is-active {
  background: var(--sidebar-soft);
  color: white;
}

.nav-item.is-active span {
  color: #b9c2ae;
}

.sidebar-bottom {
  margin-top: auto;

  padding-top: 22px;

  border-top: 1px solid var(--line-dark);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 0 7px;
}

.status-dot {
  width: 8px;
  height: 8px;

  flex: 0 0 auto;

  border-radius: 50%;

  background: #7f9b70;

  box-shadow: 0 0 0 4px rgba(127, 155, 112, 0.1);
}

.system-status div {
  display: flex;
  flex-direction: column;
}

.system-status strong {
  font: 600 0.61rem var(--ui);
}

.system-status small {
  margin-top: 4px;

  font-size: 0.55rem;

  color: rgba(255, 255, 255, 0.35);
}

.guest-link {
  display: inline-block;

  margin: 22px 7px 0;

  padding-bottom: 4px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.2);

  font: 600 0.56rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;

  color: rgba(255, 255, 255, 0.45);
}


/* -------------------------------------------------------
   MAIN LAYOUT
------------------------------------------------------- */

.ops-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.ops-header {
  padding:
    clamp(48px, 5vw, 72px)
    clamp(28px, 4vw, 64px)
    35px;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 50px;

  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 13px;

  font: 700 0.56rem var(--ui);
  letter-spacing: 0.13em;
  text-transform: uppercase;

  color: var(--olive);
}

.ops-header h1 {
  font: 500 clamp(3.5rem, 5vw, 5.5rem) / 0.95 var(--serif);
  letter-spacing: -0.045em;
}

.date-line {
  margin-top: 14px;

  font-size: 0.72rem;

  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.shift-status {
  padding-right: 20px;

  border-right: 1px solid var(--line);

  display: flex;
  flex-direction: column;
  text-align: right;
}

.shift-status span {
  font: 600 0.54rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;

  color: var(--muted);
}

.shift-status strong {
  margin-top: 5px;

  font: 600 0.68rem var(--ui);
}

.command-button {
  min-height: 42px;
  padding: 0 16px;

  border: 0;

  background: var(--ink);
  color: white;

  font: 700 0.57rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* -------------------------------------------------------
   PROTOTYPE BANNER
------------------------------------------------------- */

.prototype-banner {
  padding: 17px clamp(28px, 4vw, 64px);

  display: grid;
  grid-template-columns: 0.35fr 1fr;
  gap: 35px;

  background: #d9d4c8;
}

.prototype-banner strong {
  font: 600 0.67rem var(--ui);
}

.prototype-banner p {
  max-width: 850px;

  font-size: 0.65rem;
  line-height: 1.6;

  color: #66645e;
}


/* -------------------------------------------------------
   METRICS
------------------------------------------------------- */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);

  margin: 0 clamp(28px, 4vw, 64px);

  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.metric {
  min-height: 155px;

  padding: 22px;

  display: flex;
  flex-direction: column;

  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);

  background: rgba(255, 255, 255, 0.17);
}

.metric > span {
  font: 700 0.55rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.09em;

  color: var(--muted);
}

.metric strong {
  margin-top: auto;

  font: 500 clamp(2rem, 3vw, 3.5rem) var(--serif);
  letter-spacing: -0.04em;
}

.metric p {
  margin-top: 5px;

  font-size: 0.61rem;

  color: var(--muted);
}


/* -------------------------------------------------------
   OPERATIONS GRID
------------------------------------------------------- */

.operations-layout {
  padding: 46px clamp(28px, 4vw, 64px) 70px;

  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.62fr);
  gap: 28px;
  align-items: start;
}

.primary-column,
.secondary-column {
  min-width: 0;
}

.secondary-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  border: 1px solid var(--line);

  background: var(--surface);
}

.panel-heading {
  min-height: 92px;
  padding: 22px 24px;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  border-bottom: 1px solid var(--line);
}

.panel-heading.compact {
  min-height: 82px;
}

.panel-heading .eyebrow {
  margin-bottom: 7px;
}

.panel-heading h2 {
  font: 500 1.9rem var(--serif);
  letter-spacing: -0.03em;
}

.count-pill {
  min-width: 35px;
  height: 35px;
  padding: 0 10px;

  display: inline-grid;
  place-items: center;

  border-radius: 30px;

  background: var(--ink);
  color: white;

  font: 700 0.62rem var(--ui);
}


/* -------------------------------------------------------
   ATTENTION CARDS
------------------------------------------------------- */

.attention-list {
  display: flex;
  flex-direction: column;
}

.attention-card {
  display: grid;
  grid-template-columns: 105px 1fr;

  border-bottom: 1px solid var(--line);

  background: var(--surface);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease;
}

.attention-card:last-child {
  border-bottom: 0;
}

.attention-card.is-resolved {
  opacity: 0.46;
  background: #eef0e9;
}

.attention-time {
  padding: 25px 20px;

  border-right: 1px solid var(--line);
}

.attention-time strong {
  display: block;

  font: 500 1.5rem var(--serif);
}

.attention-time span {
  display: block;

  margin-top: 7px;

  font: 600 0.52rem var(--ui);
  letter-spacing: 0.07em;
  text-transform: uppercase;

  color: var(--muted);
}

.attention-content {
  padding: 25px;
}

.issue-type {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.issue-type span {
  font: 700 0.55rem var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: var(--olive);
}

.issue-type small {
  font-size: 0.57rem;

  color: var(--muted);
}

.attention-content h3 {
  margin-top: 12px;

  font: 500 1.45rem var(--serif);
}

.attention-content > p {
  max-width: 720px;
  margin-top: 9px;

  font-size: 0.7rem;
  line-height: 1.65;

  color: var(--muted);
}

.context-row {
  margin-top: 18px;

  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.context-row > span {
  padding: 7px 9px;

  border: 1px solid var(--line);

  font-size: 0.56rem;

  color: var(--muted);
}

.context-row strong {
  margin-left: 4px;

  color: var(--ink);
}

.context-row .warning {
  color: var(--red);
}

.recommendation {
  margin-top: 20px;
  padding: 15px 17px;

  border-left: 3px solid var(--olive);

  background: var(--surface-2);
}

.recommendation span {
  display: block;

  font: 700 0.52rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;

  color: var(--olive);
}

.recommendation p {
  margin-top: 7px;

  font-size: 0.65rem;
  line-height: 1.6;

  color: #5f625a;
}

.card-actions {
  margin-top: 19px;

  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.card-actions button {
  min-height: 37px;
  padding: 0 13px;

  border: 0;

  background: var(--ink);
  color: white;

  font: 700 0.54rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-actions .secondary-action {
  border: 1px solid var(--line);

  background: transparent;
  color: var(--ink);
}

.priority-high {
  border-left: 4px solid var(--red);
}

.priority-medium {
  border-left: 4px solid var(--amber);
}

/* -------------------------------------------------------
   REVENUE OPPORTUNITIES
------------------------------------------------------- */

.revenue-panel {
  overflow: hidden;
}

.opportunity-card {
  padding: 22px;

  border-bottom: 1px solid var(--line);
}

.opportunity-card:last-child {
  border-bottom: 0;
}

.opportunity-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.opportunity-top span {
  font: 700 0.54rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;

  color: var(--olive);
}

.opportunity-top strong {
  font: 600 0.77rem var(--ui);

  color: var(--olive);
}

.opportunity-card h3 {
  margin-top: 18px;

  font: 500 1.35rem var(--serif);
}

.opportunity-card > p {
  margin-top: 8px;

  font-size: 0.67rem;
  line-height: 1.6;

  color: var(--muted);
}

.opportunity-card dl {
  margin-top: 20px;

  border-top: 1px solid var(--line);
}

.opportunity-card dl div {
  padding: 9px 0;

  display: flex;
  justify-content: space-between;
  gap: 15px;

  border-bottom: 1px solid var(--line);
}

.opportunity-card dt,
.opportunity-card dd {
  font-size: 0.59rem;
}

.opportunity-card dt {
  color: var(--muted);
}

.opportunity-card dd {
  color: var(--ink);
}

.opportunity-card button {
  margin-top: 18px;

  min-height: 37px;
  padding: 0 13px;

  border: 0;

  background: var(--olive);
  color: white;

  font: 700 0.53rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* -------------------------------------------------------
   CAPACITY
------------------------------------------------------- */

.capacity-panel {
  padding-bottom: 5px;
}

.capacity-item {
  padding: 19px 22px;

  border-bottom: 1px solid var(--line);
}

.capacity-item:last-child {
  border-bottom: 0;
}

.capacity-item > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 18px;
}

.capacity-item span {
  font-size: 0.64rem;
}

.capacity-item strong {
  font: 600 0.65rem var(--ui);
}

.capacity-bar {
  height: 5px;
  margin-top: 11px;

  overflow: hidden;

  background: #ddd8cd;
}

.capacity-bar span {
  display: block;
  height: 100%;

  background: var(--olive);
}

.capacity-item small {
  display: block;

  margin-top: 8px;

  font-size: 0.55rem;

  color: var(--muted);
}


/* -------------------------------------------------------
   PRINCIPLE PANEL
------------------------------------------------------- */

.principle-panel {
  padding: 27px;

  background: var(--olive);
  color: white;
}

.panel-index {
  font: 700 0.53rem var(--ui);
  letter-spacing: 0.1em;

  color: rgba(255, 255, 255, 0.55);
}

.principle-panel blockquote {
  margin-top: 45px;

  font: 500 2.1rem / 1.08 var(--serif);
  letter-spacing: -0.03em;
}

.principle-panel p {
  margin-top: 21px;

  font-size: 0.65rem;
  line-height: 1.65;

  color: rgba(255, 255, 255, 0.62);
}


/* -------------------------------------------------------
   DECISION STRIP
------------------------------------------------------- */

.decision-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  margin: 0 clamp(28px, 4vw, 64px) 70px;

  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.decision-strip article {
  min-height: 165px;

  padding: 22px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.decision-strip span {
  font: 700 0.54rem var(--ui);

  color: var(--olive);
}

.decision-strip strong {
  max-width: 12ch;

  font: 500 1.6rem / 1.12 var(--serif);
}


/* -------------------------------------------------------
   FOOTER
------------------------------------------------------- */

.ops-footer {
  min-height: 105px;

  padding: 25px clamp(28px, 4vw, 64px);

  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 35px;

  background: #0e100d;
  color: white;
}

.ops-footer > div {
  display: flex;
  flex-direction: column;
}

.ops-footer strong {
  font: 700 0.64rem var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-footer span,
.ops-footer p,
.ops-footer a {
  font-size: 0.57rem;

  color: rgba(255, 255, 255, 0.43);
}

.ops-footer span {
  margin-top: 5px;
}

.ops-footer a {
  padding-bottom: 3px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}


/* -------------------------------------------------------
   CONTEXT DRAWER
------------------------------------------------------- */

.context-drawer {
  position: fixed;
  inset: 0;

  z-index: 100;

  visibility: hidden;
  pointer-events: none;
}

.context-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.context-backdrop {
  position: absolute;
  inset: 0;

  border: 0;

  background: rgba(10, 12, 9, 0.55);

  opacity: 0;

  transition: opacity 0.25s ease;
}

.context-drawer.is-open .context-backdrop {
  opacity: 1;
}

.context-panel {
  width: min(520px, 100%);
  height: 100%;

  position: absolute;
  inset: 0 0 0 auto;

  padding: 35px 38px;

  overflow-y: auto;

  background: var(--surface);

  transform: translateX(100%);

  transition: transform 0.3s ease;
}

.context-drawer.is-open .context-panel {
  transform: translateX(0);
}

.context-close {
  display: block;

  margin-left: auto;
  margin-bottom: 65px;

  padding: 6px 0;

  border: 0;
  border-bottom: 1px solid var(--ink);

  background: transparent;

  font: 700 0.53rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.context-panel h2 {
  font: 500 2.8rem / 1 var(--serif);
  letter-spacing: -0.04em;
}

.context-body {
  margin-top: 35px;
}

.context-section {
  padding: 18px 0;

  border-top: 1px solid var(--line);
}

.context-section h3 {
  font: 600 0.58rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;

  color: var(--olive);
}

.context-section p {
  margin-top: 8px;

  font-size: 0.68rem;
  line-height: 1.65;

  color: var(--muted);
}


/* -------------------------------------------------------
   COMMAND PALETTE
------------------------------------------------------- */

.command-palette {
  position: fixed;
  inset: 0;

  z-index: 120;

  display: grid;
  place-items: start center;

  padding-top: 12vh;

  visibility: hidden;
  pointer-events: none;
}

.command-palette.is-open {
  visibility: visible;
  pointer-events: auto;
}

.command-backdrop {
  position: absolute;
  inset: 0;

  border: 0;

  background: rgba(10, 12, 9, 0.67);

  opacity: 0;

  transition: opacity 0.2s ease;
}

.command-palette.is-open .command-backdrop {
  opacity: 1;
}

.command-dialog {
  width: min(650px, calc(100% - 32px));

  position: relative;
  z-index: 2;

  padding: 24px;

  background: var(--surface);

  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.25);

  transform: translateY(-12px);
  opacity: 0;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.command-palette.is-open .command-dialog {
  transform: translateY(0);
  opacity: 1;
}

.command-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.command-heading > div {
  display: flex;
  flex-direction: column;
}

.command-heading strong {
  font: 600 0.68rem var(--ui);
}

.command-heading small {
  margin-top: 3px;

  font-size: 0.55rem;

  color: var(--muted);
}

#opsAssistantForm {
  margin-top: 23px;

  display: grid;
  grid-template-columns: 1fr auto;

  border: 1px solid var(--line);
}

#opsAssistantInput {
  min-height: 53px;
  padding: 0 15px;

  border: 0;
  outline: 0;

  background: transparent;

  font-size: 0.72rem;
}

#opsAssistantForm button {
  padding: 0 19px;

  border: 0;

  background: var(--ink);
  color: white;

  font: 700 0.54rem var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.command-response {
  margin-top: 18px;
  padding: 16px;

  background: var(--surface-2);

  font-size: 0.67rem;
  line-height: 1.65;

  color: var(--muted);
}


/* -------------------------------------------------------
   TOAST
------------------------------------------------------- */

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;

  z-index: 150;

  padding: 12px 16px;

  background: var(--ink);
  color: white;

  font: 600 0.59rem var(--ui);

  transform: translateY(25px);
  opacity: 0;
  pointer-events: none;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}


/* -------------------------------------------------------
   RESPONSIVE
------------------------------------------------------- */

@media (max-width: 1180px) {

  :root {
    --sidebar-width: 205px;
  }

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

  .operations-layout {
    grid-template-columns: 1fr;
  }

  .secondary-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .principle-panel {
    grid-column: 1 / -1;
  }

}

@media (max-width: 820px) {

  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    width: 100%;
    height: auto;

    position: relative;

    padding: 16px 18px;

    display: block;
  }

  .ops-brand {
    padding-bottom: 16px;
  }

  .ops-nav {
    margin-top: 15px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-item {
    min-height: 38px;

    grid-template-columns: 1fr;

    text-align: center;
  }

  .nav-item span {
    display: none;
  }

  .sidebar-bottom {
    display: none;
  }

  .ops-main {
    margin-left: 0;
  }

  .ops-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .prototype-banner {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .attention-card {
    grid-template-columns: 1fr;
  }

  .attention-time {
    border-right: 0;
    border-bottom: 1px solid var(--line);

    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .attention-time span {
    margin-top: 0;
  }

  .secondary-column {
    grid-template-columns: 1fr;
  }

  .principle-panel {
    grid-column: auto;
  }

  .decision-strip {
    grid-template-columns: 1fr;
  }

  .ops-footer {
    grid-template-columns: 1fr;
    gap: 14px;
  }

}

@media (max-width: 560px) {

  .ops-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;

    margin-left: 18px;
    margin-right: 18px;
  }

  .ops-header,
  .operations-layout {
    padding-left: 18px;
    padding-right: 18px;
  }

  .prototype-banner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .decision-strip {
    margin-left: 18px;
    margin-right: 18px;
  }

  .issue-type {
    flex-direction: column;
    gap: 5px;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions button {
    width: 100%;
  }

  .context-panel {
    padding: 28px 22px;
  }

}

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

}