/* Pacificao Assist MVP */
:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #596662;
  --line: #d9e1dc;
  --paper: #f7f8f4;
  --panel: #ffffff;
  --green: #285f4c;
  --gold: #b48a35;
  --blue: #244b66;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: white;
  background: var(--green);
}

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
}

.nav a,
.site-footer a {
  text-decoration: none;
}

.nav a:hover,
.site-footer a:hover {
  color: var(--green);
}

.hero {
  min-height: 58vh;
  display: grid;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 22px 72px;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 21px;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 21px;
}

.band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 72px 22px;
}

.section-heading,
.project-grid,
.split {
  max-width: 1120px;
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 28px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.project-grid article {
  min-height: 210px;
  padding: 28px;
  background: var(--panel);
}

.project-grid p,
.split p,
.site-footer {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 48px;
  align-items: start;
  padding: 72px 22px;
}

.split > p {
  margin-top: 34px;
  font-size: 19px;
}

.site-footer {
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.tools-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 246, 241, 0.98) 340px),
    #f4f6f1;
}

.tools-hero,
.tools-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px;
}

.tools-hero {
  padding-bottom: 44px;
}

.tools-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 58px;
}

.tools-nav a {
  color: var(--muted);
  text-decoration: none;
}

.tools-nav .brand-row {
  color: var(--ink);
}

.tools-hero h1 {
  max-width: 940px;
  font-size: clamp(40px, 6vw, 72px);
}

.tools-layout {
  display: grid;
  gap: 54px;
  padding-bottom: 80px;
}

.tools-section {
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

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

.tool-link {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

.tool-link:hover {
  border-color: rgba(40, 95, 76, 0.45);
  box-shadow: 0 14px 34px rgba(24, 33, 31, 0.08);
}

.tool-link strong {
  font-size: 18px;
}

.tool-link span,
.tool-link small {
  color: var(--muted);
}

.tool-link small {
  align-self: end;
  overflow-wrap: anywhere;
  font-size: 12px;
}

@media (max-width: 760px) {
  .site-header,
  .site-footer,
  .split {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    flex-wrap: wrap;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  h1 {
    font-size: 44px;
  }

  .lead {
    font-size: 18px;
  }

  .project-grid,
  .split,
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .split > p {
    margin-top: 0;
  }
}

/* Pacificao Assist application overrides */
body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(244, 246, 241, 0.96) 260px),
    #f4f6f1;
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
}

button:hover {
  background: #1f4b3d;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(22, 31, 28, 0.08);
}

.login h1,
.workspace h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.05;
}

.workspace h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.15;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a,
.sidebar-foot a {
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--ink);
  background: #eef3ee;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  width: min(1220px, 100%);
  display: grid;
  gap: 16px;
  padding: 26px;
}

.topbar,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-menu {
  position: relative;
}

.app-menu summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  list-style: none;
}

.app-menu summary::-webkit-details-marker {
  display: none;
}

.app-menu-panel {
  position: absolute;
  right: 0;
  z-index: 20;
  min-width: 190px;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(22, 31, 28, 0.12);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--green);
  background: #e6f0eb;
  font-size: 13px;
  font-weight: 800;
}

.status-pill.warn {
  color: #a13c3c;
  background: #f7e8e6;
}

.metrics,
.grid {
  display: grid;
  gap: 14px;
}

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

.metrics article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(22, 31, 28, 0.04);
}

.metrics article {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.metrics span,
.list-meta,
.form-status {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  font-size: 30px;
  line-height: 1;
}

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

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

.panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.workspace-section {
  display: none;
}

.workspace-section.active {
  display: grid;
}

.focus-panel {
  align-content: start;
}

.panel-copy {
  max-width: 62ch;
  color: var(--muted);
}

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

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

.form-grid textarea,
.assistant-form textarea,
.form-grid button,
.assistant-form button {
  grid-column: 1 / -1;
}

.form-grid.compact button {
  grid-column: auto;
}

.assistant-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.assistant-tabs button {
  color: var(--ink);
  background: #eef3ee;
}

.assistant-tabs button.active {
  color: #fff;
  background: var(--blue);
}

.assistant-output {
  min-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: #24302d;
  background: #f8faf7;
}

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

.list-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
}

.list-item strong {
  font-size: 15px;
}

.inline-note {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
}

.inline-note button {
  white-space: nowrap;
}

.connection-settings {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
}

.connection-settings summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.settings-grid button {
  grid-column: 1 / -1;
}

.email-toolbar {
  display: grid;
  gap: 12px;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.oauth-connect {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.oauth-connect div {
  display: grid;
  gap: 2px;
}

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

.account-form .settings-grid,
.account-form .form-actions {
  grid-column: 1 / -1;
}

.form-actions,
.manager-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-manager-list {
  display: grid;
  gap: 8px;
}

.manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.manager-row div:first-child {
  display: grid;
  gap: 2px;
}

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

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

.account-chip {
  display: inline-grid;
  gap: 2px;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.account-chip strong,
.account-chip span {
  overflow-wrap: anywhere;
}

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

.account-chip small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.email-capture {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.email-capture textarea,
.email-capture button {
  grid-column: 1 / -1;
}

.email-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 360px;
}

.email-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.email-row {
  height: auto;
  min-height: 82px;
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.email-row:hover,
.email-row.active {
  border-color: #9eb3a8;
  background: #edf4ef;
}

.email-row span,
.email-row strong,
.email-row small {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.email-row small,
.empty-state,
.email-detail-head p {
  color: var(--muted);
}

.email-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.email-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.email-detail h3 {
  margin-bottom: 4px;
}

.email-body {
  max-height: 190px;
  overflow: auto;
  white-space: pre-wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf7;
}

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

button.secondary {
  color: var(--ink);
  background: #eef1ee;
}

button.danger {
  color: #8f2f2f;
  background: #f7e8e6;
}

.small-button {
  min-height: 34px;
  justify-self: start;
  padding: 0 11px;
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar nav {
    grid-template-columns: repeat(5, max-content);
    overflow-x: auto;
  }

  .metrics,
  .grid.two,
  .email-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .panel-head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

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

  .form-grid,
  .assistant-form,
  .inline-note,
  .account-form,
  .settings-grid,
  .email-capture {
    grid-template-columns: 1fr;
  }

  .manager-row {
    align-items: stretch;
    flex-direction: column;
  }

  .oauth-connect {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid.compact button {
    grid-column: 1;
  }
}
