:root {
  --ink: #343235;
  --muted: #858189;
  --faint: #d9d2cb;
  --line: rgba(48, 45, 49, 0.08);
  --panel: rgba(255, 255, 255, 0.68);
  --paper: #fff7ee;
  --paper-2: #fffafb;
  --pink: #ff9bae;
  --pink-2: #ffc4e5;
  --peach: #ffe5d0;
  --blue: #d9eaf6;
  --violet: #ead9ef;
  --rose: #f7dce9;
  --grey: #aaa7a2;
  --shadow: 0 22px 42px rgba(56, 47, 38, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(108deg, #fff5f8 0%, #fff4ea 48%, #fffdfc 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input {
  font: inherit;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 36px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 20px;
  font-weight: 800;
  color: #ffa4b4;
}

.brand span {
  color: #ffd4c6;
}

.account {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: right;
}

.account strong,
.account small {
  display: block;
}

.account strong {
  font-size: 14px;
}

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

.logout,
.login-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #302f31;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.shell {
  display: flex;
  min-height: 100vh;
  padding-top: 66px;
}

.sidebar {
  position: fixed;
  top: 66px;
  bottom: 0;
  left: 0;
  width: 255px;
  padding: 42px 20px;
  background: rgba(255, 255, 255, 0.58);
  border-right: 1px solid var(--line);
}

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

.sidebar a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  padding: 7px 4px;
  color: #48454b;
  font-size: 14px;
  font-weight: 600;
}

.sidebar a.active {
  color: #242225;
}

.sidebar svg {
  width: 19px;
  height: 19px;
}

.workspace {
  width: 100%;
  margin-left: 255px;
  padding: 50px clamp(28px, 6vw, 92px);
}

.launcher {
  min-height: calc(100vh - 66px);
}

.launcher-hero {
  margin: 0 auto 38px;
  text-align: center;
}

.launcher-hero h1 {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 12px;
  color: #464447;
  font-size: clamp(34px, 4vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.launcher-hero .mascot {
  display: inline-block;
  color: #464447;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  line-height: 0.78;
  transform: translateY(3px);
}

.launcher-hero p {
  margin: 0;
  color: #858189;
  font-size: 15px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 26px;
  max-width: 1300px;
  margin: 0 auto;
}

.app-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 212px;
  padding: 24px 22px;
  border: 1px solid rgba(55, 49, 43, 0.06);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: none;
  text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.app-card.is-active {
  background: #fff;
}

.app-card.is-active:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.app-card.is-muted {
  opacity: 0.56;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  border-radius: 20px;
}

.app-icon.pink {
  background: linear-gradient(135deg, var(--pink), var(--pink-2));
  color: #fff;
}

.app-icon.peach {
  background: linear-gradient(135deg, #ffeddc, #ffd9ca);
  color: #fff;
}

.app-icon.blue {
  background: linear-gradient(135deg, #e5def6, var(--blue));
  color: #fff;
}

.app-icon.violet {
  background: linear-gradient(135deg, var(--violet), #dde2fb);
  color: #fff;
}

.app-icon.rose {
  background: linear-gradient(135deg, #ffe2f2, #eee8ee);
  color: #fff;
}

.app-icon.grey {
  background: linear-gradient(135deg, #b4b1ad, #9f9c98);
  color: #fff;
}

.app-icon svg {
  width: 34px;
  height: 34px;
}

.app-card strong {
  margin-bottom: 10px;
  font-size: 16px;
}

.app-card small {
  max-width: 170px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.soon {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: #a49f98;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module {
  display: grid;
  gap: 24px;
}

.module-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #df8193;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.module h1,
.login-card h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
}

.module-header p {
  max-width: 670px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.button.primary {
  border-color: #302f31;
  background: #302f31;
  color: #fff;
}

.metric-grid,
.workflow-grid,
.report-grid {
  display: grid;
  gap: 16px;
  max-width: 1180px;
}

.metric-grid {
  grid-template-columns: repeat(4, 1fr);
}

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

.report-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.panel,
.metric,
.workflow-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 36px rgba(56, 47, 38, 0.05);
}

.metric,
.workflow-card,
.panel {
  padding: 22px;
}

.metric span,
.workflow-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
}

.workflow-card {
  display: grid;
  gap: 14px;
}

.workflow-card svg {
  width: 28px;
  height: 28px;
  color: #df8193;
}

.workflow-card h2 {
  margin: 0;
  font-size: 18px;
}

.workflow-card p,
.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-row h2 {
  margin: 0;
  font-size: 20px;
}

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

.save-form {
  display: grid;
  gap: 24px;
}

.editable-table input {
  min-width: 90px;
  padding: 9px 10px;
}

.save-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  max-width: 1180px;
}

.allocation-summary {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

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

.status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f2eadf;
  color: #6e6257;
  font-size: 12px;
  font-weight: 800;
}

.invoice-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.invoice-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.invoice-tabs a.active {
  background: #302f31;
  color: #fff;
}

.invoice-tabs svg {
  width: 17px;
  height: 17px;
}

.extraction-hint {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px dashed rgba(223, 129, 147, 0.45);
  border-radius: 12px;
  background: rgba(255, 246, 248, 0.72);
  color: #514b52;
  font-size: 13px;
  line-height: 1.5;
}

.extraction-hint span {
  color: var(--muted);
}

.text-preview {
  max-height: 360px;
  overflow: auto;
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #4d484e;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 850px;
}

label {
  display: grid;
  gap: 7px;
  color: #4d484e;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  padding: 12px 13px;
  color: var(--ink);
}

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

.span-2 {
  grid-column: span 2;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.login-card form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

@media (max-width: 1180px) {
  .app-grid,
  .metric-grid,
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 66px;
    padding: 14px 18px;
  }

  .account div {
    display: none;
  }

  .shell {
    padding-top: 66px;
  }

  .sidebar {
    position: static;
    width: 100%;
    padding: 12px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
  }

  .sidebar a {
    min-width: max-content;
  }

  .workspace {
    margin-left: 0;
    padding: 30px 18px;
  }

  .shell {
    display: block;
  }

  .app-grid,
  .metric-grid,
  .workflow-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .module-header {
    display: grid;
  }
}
