@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f3ef;
  --surface-raised: #fbfcfa;
  --ink: #111815;
  --muted: #657269;
  --muted-soft: #87938c;
  --line: #dde4dd;
  --green: #11835c;
  --deep-green: #0e3026;
  --graphite: #26302c;
  --copper: #9a673d;
  --amber: #b57a16;
  --coral: #c45543;
  --indigo: #4c63b6;
  --shadow: 0 18px 42px rgba(17, 24, 21, 0.075);
  --shadow-soft: 0 8px 22px rgba(17, 24, 21, 0.055);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.landing-page {
  min-height: 100vh;
  background: #10251e;
}

.landing-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 4vw, 52px);
  color: #ffffff;
}

.landing-brand,
.landing-actions {
  display: flex;
  align-items: center;
}

.landing-brand {
  gap: 10px;
  font-weight: 700;
}

.brand-logo {
  display: block;
  width: min(188px, 100%);
  height: auto;
}

.landing-brand .brand-logo {
  width: min(198px, 48vw);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.22));
}

.landing-login,
.landing-primary,
.landing-secondary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
}

.landing-login {
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.landing-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #ffffff;
}

.landing-hero-media,
.landing-hero-overlay {
  position: absolute;
  inset: 0;
}

.landing-hero-media {
  background:
    linear-gradient(90deg, rgba(13, 34, 26, 0.92), rgba(13, 34, 26, 0.55) 48%, rgba(13, 34, 26, 0.2)),
    url("./assets/sendypo-hero-mail.png") center / cover no-repeat;
}

.landing-hero-overlay {
  background:
    radial-gradient(circle at 78% 30%, rgba(238, 164, 75, 0.28), transparent 32%),
    linear-gradient(180deg, rgba(13, 34, 26, 0.28), rgba(13, 34, 26, 0.84));
}

.landing-hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 36px));
  margin-left: clamp(18px, 7vw, 96px);
  padding-top: 58px;
}

.landing-hero-content h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(52px, 8vw, 118px);
  line-height: 0.92;
}

.landing-hero-content p:not(.eyebrow) {
  max-width: 650px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 20px;
  line-height: 1.55;
}

.landing-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.landing-primary,
.landing-secondary {
  padding: 0 18px;
}

.landing-primary {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.landing-secondary {
  border: 1px solid rgba(255, 255, 255, 0.48);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.app-page {
  overflow-x: hidden;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(22, 132, 91, 0.12), transparent 44%),
    #f5f7f6;
}

.auth-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  padding: 0;
}

.auth-brand .brand-logo {
  width: 196px;
}

.auth-panel h1 {
  margin: 6px 0 0;
  font-size: 30px;
  line-height: 1.1;
}

.auth-panel p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

.form-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.form-status[data-tone="ok"] {
  color: var(--green);
}

.form-status[data-tone="error"] {
  color: var(--coral);
}

.inline-status {
  display: block;
  margin: -6px 0 12px;
}

body[data-auth-state="signed-in"] .auth-gate {
  display: none;
}

body[data-auth-state="signed-out"] .app-shell,
body[data-auth-state="checking"] .app-shell,
body[data-auth-state="signed-out"] .product-shell,
body[data-auth-state="checking"] .product-shell,
.product-shell[hidden] {
  display: none;
}

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

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 4px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 700;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.select-block,
.toolbar-select {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.select-block {
  padding: 0 8px;
}

.select-block select,
.toolbar-select select {
  min-height: 36px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--ink);
  background: var(--surface-soft);
}

body[data-panel-mode="simple"] [data-advanced="true"],
body[data-panel-mode="simple"] .advanced-only {
  display: none !important;
}

.sidebar-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar,
.panel-heading,
.section-header,
.state-strip,
.top-actions,
.form-row {
  display: flex;
  align-items: center;
}

.topbar,
.section-header {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

p {
  margin: 0;
}

.top-actions {
  justify-content: flex-end;
  gap: 10px;
}

.primary-action,
.secondary-action {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.primary-action {
  padding: 0 16px;
  border-color: var(--green);
  color: #ffffff;
  background: linear-gradient(180deg, #159266, #0f7452);
  box-shadow: 0 8px 18px rgba(17, 131, 92, 0.18);
  font-weight: 700;
}

.secondary-action {
  padding: 0 16px;
  color: var(--deep-green);
  background: var(--surface-raised);
  font-weight: 700;
}

.segmented-control {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.segmented-control .is-selected {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(20, 31, 27, 0.12);
}

.state-strip {
  gap: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.state-item {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.state-item strong,
.state-item span {
  display: block;
}

.state-item span {
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.wait {
  background: var(--amber);
}

.status-dot.neutral {
  background: var(--indigo);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card,
.panel,
.flow-step,
.platform-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 14px;
}

.metric-card strong,
.metric-card span {
  display: block;
}

.metric-card strong {
  margin: 4px 0;
  font-size: 28px;
}

.metric-label,
.metric-card span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.campaign-form {
  display: grid;
  gap: 12px;
}

.campaign-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.campaign-form input,
.campaign-form textarea,
.campaign-form select {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
}

.campaign-form input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.campaign-form textarea {
  resize: vertical;
}

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

.form-row {
  flex-wrap: wrap;
  gap: 12px;
}

.toggle-line,
.rule-list label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge,
.pill.ok {
  color: var(--green);
  background: #e7f5ee;
}

.pill.wait {
  color: var(--amber);
  background: #fff4dd;
}

.action-list,
.assistant-list,
.quality-list,
.endpoint-list,
.rule-list {
  display: grid;
  gap: 12px;
}

.action-card,
.assistant-list article,
.quality-list div,
.endpoint-list article {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.action-card strong,
.action-card span,
.assistant-list strong,
.assistant-list span,
.endpoint-list strong,
.endpoint-list span {
  display: block;
}

.action-card span,
.assistant-list span,
.endpoint-list span,
.quality-list div {
  color: var(--muted);
}

.simple-flow,
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.flow-step,
.platform-card {
  padding: 16px;
}

.flow-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green);
  font-weight: 700;
}

.flow-step strong,
.platform-card strong {
  display: block;
  margin-bottom: 8px;
}

.flow-step p,
.platform-card p,
.brand-preview p {
  color: var(--muted);
  line-height: 1.5;
}

.platform-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
}

.kanban article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.kanban span {
  padding: 10px;
  border-radius: 6px;
  background: var(--surface);
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  margin-bottom: 16px;
  border: 1px dashed var(--green);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbf9;
  text-align: center;
}

.drop-zone strong {
  color: var(--ink);
  font-size: 20px;
}

.bars {
  display: grid;
  gap: 12px;
}

.bars span {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  font-weight: 700;
}

.bars span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--value) * 1%);
  background: rgba(22, 132, 91, 0.14);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 700;
}

.report-chart {
  height: 300px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.report-chart span {
  flex: 1;
  min-width: 20px;
  border-radius: 6px 6px 0 0;
  background: var(--indigo);
}

.brand-preview {
  display: grid;
  align-content: center;
  gap: 18px;
}

.brand-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.brand-preview-card .brand-logo {
  width: 188px;
}

.brand-preview-card strong,
.brand-preview-card span {
  display: block;
}

.brand-preview-card span {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .metrics-grid,
  .simple-flow,
  .platform-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 980px) {
  .landing-hero-content {
    margin-right: 18px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .sidebar-note {
    display: none;
  }

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

@media (max-width: 620px) {
  .landing-nav {
    padding: 12px 14px;
  }

  .landing-login {
    min-width: 92px;
  }

  .landing-hero {
    align-items: end;
  }

  .landing-hero-media {
    background:
      linear-gradient(180deg, rgba(13, 34, 26, 0.18), rgba(13, 34, 26, 0.9)),
      url("./assets/sendypo-hero-mail.png") center / cover no-repeat;
  }

  .landing-hero-content {
    width: calc(100% - 28px);
    margin: 0 14px;
    padding: 86px 0 34px;
  }

  .landing-hero-content h1 {
    font-size: 54px;
  }

  .landing-hero-content p:not(.eyebrow) {
    font-size: 17px;
  }

  .landing-primary,
  .landing-secondary {
    width: 100%;
  }

  .workspace {
    padding: 14px;
  }

  .top-actions,
  .toolbar-select,
  .toolbar-select select,
  .segmented-control,
  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .segmented-control button,
  .primary-action,
  .secondary-action {
    flex: 1;
  }

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

  .metrics-grid,
  .simple-flow,
  .platform-grid,
  .kanban,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.product-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background:
    linear-gradient(135deg, rgba(14, 48, 38, 0.075), transparent 34%),
    linear-gradient(225deg, rgba(154, 103, 61, 0.055), transparent 38%),
    repeating-linear-gradient(90deg, rgba(17, 24, 21, 0.025) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(17, 24, 21, 0.018) 0 1px, transparent 1px 72px),
    #f6f7f4;
}

.product-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 16px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  border-right: 1px solid rgba(13, 22, 18, 0.14);
  background:
    linear-gradient(180deg, rgba(22, 132, 91, 0.16), transparent 42%),
    #141c18;
}

.product-sidebar::-webkit-scrollbar {
  width: 8px;
}

.product-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.product-sidebar::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  background-clip: padding-box;
}

.app-brand {
  min-height: 48px;
  padding-left: 2px;
}

.app-brand .brand-logo {
  width: 198px;
}

.module-nav,
.menu-group {
  display: grid;
  gap: 5px;
}

.module-nav {
  gap: 15px;
}

.menu-label {
  padding: 0 8px;
  color: rgba(236, 241, 237, 0.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.menu-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: rgba(244, 247, 245, 0.78);
  background: transparent;
  text-align: left;
}

.menu-item small {
  min-width: 24px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(244, 247, 245, 0.88);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.menu-item:hover,
.menu-item.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.menu-item.is-active small {
  color: #141c18;
  background: #b7e6c9;
}

.product-sidebar .brand strong {
  color: #ffffff;
}

.product-sidebar .brand span,
.product-sidebar .select-block {
  color: rgba(244, 247, 245, 0.68);
}

.product-sidebar .select-block select {
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.product-sidebar .sidebar-note {
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(244, 247, 245, 0.74);
  background: rgba(255, 255, 255, 0.06);
}

.product-main {
  position: relative;
  min-width: 0;
  padding: 30px clamp(22px, 3vw, 42px);
}

.product-main::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 280px;
  height: 260px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), transparent),
    linear-gradient(120deg, rgba(17, 131, 92, 0.09), rgba(154, 103, 61, 0.05) 52%, transparent);
}

.product-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: -30px calc(clamp(22px, 3vw, 42px) * -1) 24px;
  padding: 22px clamp(22px, 3vw, 42px);
  border-bottom: 1px solid rgba(216, 222, 216, 0.9);
  background: rgba(246, 247, 244, 0.78);
  backdrop-filter: blur(18px) saturate(1.12);
}

.product-topbar h1 {
  font-size: 29px;
  font-weight: 700;
  line-height: 1.12;
}

.topbar-subtitle {
  display: block;
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.topbar-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.compact-control {
  min-width: 170px;
}

.toolbar-select select:disabled {
  color: #6c7974;
  background: #eef3ef;
}

.toolbar-select select,
.select-block select,
.stack-form input,
.stack-form textarea,
.stack-form select,
.inline-form input {
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.toolbar-select select:focus,
.select-block select:focus,
.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus,
.inline-form input:focus {
  outline: 0;
  border-color: rgba(17, 131, 92, 0.58);
  box-shadow: 0 0 0 3px rgba(17, 131, 92, 0.12);
}

.action-menu {
  position: relative;
}

.action-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 202px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 56px rgba(17, 24, 21, 0.16);
}

.action-popover button {
  min-height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.action-popover button:hover {
  background: var(--surface-soft);
}

.product-view {
  display: none;
}

.product-view.is-visible {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  max-width: 1520px;
}

.overview-hero {
  min-height: 144px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.74)),
    linear-gradient(120deg, rgba(17, 131, 92, 0.18), rgba(154, 103, 61, 0.12));
}

.overview-hero h2 {
  max-width: 640px;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.16;
}

.overview-hero p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

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

.status-board,
.dashboard-grid,
.split-view,
.assistant-grid,
.metric-row {
  display: grid;
  gap: 14px;
}

.status-board {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.8fr);
}

.split-view {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
  align-items: start;
}

.assistant-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.work-card,
.status-tile {
  border: 1px solid rgba(221, 228, 221, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.08);
  box-shadow: var(--shadow-soft);
}

.work-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.work-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(17, 131, 92, 0.36), rgba(154, 103, 61, 0.18), transparent);
}

.work-card > * {
  position: relative;
}

.status-tile {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
}

.status-tile strong,
.status-tile span {
  display: block;
}

.status-tile span:not(.status-dot) {
  color: var(--muted);
  font-size: 14px;
}

.status-tile strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title h2,
.work-card h2 {
  font-weight: 700;
  line-height: 1.18;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-list button {
  min-height: 76px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 4px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(250, 251, 249, 0.78);
  text-align: left;
}

.task-list.compact button {
  min-height: 62px;
}

.task-list .status-dot {
  grid-row: span 2;
  margin-top: 5px;
}

.task-list strong,
.task-list small {
  min-width: 0;
  display: block;
}

.task-list small {
  color: var(--muted);
  font-size: 14px;
}

.role-summary {
  display: grid;
  gap: 14px;
}

.role-summary p,
.muted-copy,
.assistant-grid p {
  color: var(--muted);
  line-height: 1.55;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-list span,
.tag-list span,
.template-list small {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #40514b;
  background: #eef2ed;
  font-size: 12px;
  font-weight: 700;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid rgba(221, 228, 221, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.table-shell table {
  min-width: 640px;
}

.table-shell th,
.table-shell td {
  background: transparent;
}

.side-editor {
  position: sticky;
  top: 118px;
}

.stack-form,
.inline-form,
.narrow-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  grid-template-columns: minmax(190px, 1fr) minmax(140px, 0.6fr) auto;
  margin-bottom: 14px;
}

.stack-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stack-form input,
.stack-form textarea,
.stack-form select,
.inline-form input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
}

.stack-form textarea {
  resize: vertical;
}

.stack-form input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.tag-list,
.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-list {
  display: grid;
}

.template-list article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.template-list span {
  color: var(--muted);
}

.suppression-box {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.metric-row {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  margin-bottom: 16px;
}

.metric-row article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.metric-row span,
.metric-row strong {
  display: block;
}

.metric-row span {
  color: var(--muted);
}

.metric-row strong {
  margin-top: 6px;
  font-size: 30px;
}

.empty-state {
  min-height: 126px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fafbf9;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.pill.ok {
  border-radius: 999px;
}

@media (max-width: 1180px) {
  .product-topbar {
    position: static;
    flex-direction: column;
    margin-top: 0;
  }

  .topbar-tools {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .side-editor {
    position: static;
  }

  .status-board,
  .metric-row {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .dashboard-grid,
  .split-view,
  .assistant-grid {
    grid-template-columns: 1fr;
  }
}

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

  .product-sidebar {
    position: static;
    height: auto;
    min-height: auto;
    max-height: none;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .product-main::before {
    left: 0;
  }

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

  .overview-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .product-main {
    padding: 14px;
  }

  .product-topbar {
    margin-inline: -14px;
    padding: 14px;
  }

  .topbar-tools,
  .compact-control,
  .toolbar-select select,
  .topbar-tools > .primary-action,
  .topbar-tools > .secondary-action,
  .action-menu,
  .action-menu > .primary-action {
    width: 100%;
  }

  .status-board,
  .metric-row,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .module-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .menu-group {
    min-width: 168px;
  }

  .overview-hero h2,
  .product-topbar h1 {
    font-size: 25px;
  }
}
