:root {
  --ink: #172c35;
  --muted: #526570;
  --line: #d9e2e6;
  --green: #146653;
  --bg: #f1f5f7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font:
    16px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Noto Sans TC",
    sans-serif;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
select {
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 10px 15px;
  color: var(--ink);
}
button:hover {
  background: #eff5f2;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button.primary:hover {
  background: #205e4f;
}
.danger {
  color: #b65245;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 246px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 31px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--green);
  font-size: 43px;
  font-weight: 850;
  letter-spacing: -4px;
}
.brand span {
  font-size: 17px;
  letter-spacing: -0.4px;
  color: var(--ink);
}
.brand small {
  display: block;
  letter-spacing: 1.4px;
  font-size: 14px;
  margin-top: 7px;
  color: var(--muted);
}
.workspace {
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 600;
}
.workspace span {
  font-size: 14px;
  flex: 1;
}
.workspace small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 6px;
}
.nav-label {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1.5px;
  margin: 30px 12px 13px;
}
nav button {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  border: 0;
  text-align: left;
  margin: 5px 0;
  color: var(--muted);
  padding: 13px 16px;
}
nav button span {
  flex: 1;
}
nav button.active {
  color: var(--green);
  background: #eaf3ef;
  font-weight: 600;
}
nav i {
  font-style: normal;
  font-size: 14px;
}
.future {
  font-size: 14px;
  color: var(--muted);
  margin: 21px 13px;
}
.future small {
  float: right;
  font-size: 14px;
  border: 1px solid #eceeed;
  padding: 3px;
}
.aside-bottom {
  margin-top: auto;
  color: var(--muted);
  font-size: 14px;
}
.online {
  color: var(--green);
  margin-bottom: 12px;
}
.shell {
  margin-left: 246px;
}
header {
  height: 80px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
header > div {
  display: flex;
  align-items: center;
  gap: 16px;
}
header em {
  font-style: normal;
  margin: 0 14px;
  color: var(--muted);
}
header b {
  font-weight: 500;
}
header select {
  border: 0;
  background: white;
  color: #586771;
  padding: 8px;
}
.avatar {
  background: #dcece5;
  color: var(--green);
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 600;
}
.demo-pill {
  font-size: 14px;
  color: #9b7a37;
  border: 1px solid #eee2c9;
  border-radius: 4px;
  padding: 4px 7px;
}
.demo-banner {
  font-size: 14px;
  background: #f4f2e9;
  color: #69501d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 38px;
}
.demo-banner button {
  padding: 3px 8px;
  background: transparent;
  border: 0;
  font-size: 14px;
  color: inherit;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 42px 38px;
  min-height: calc(100vh - 173px);
}
.eyebrow {
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--green);
  font-weight: 650;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
h1 {
  font-size: 29px;
  letter-spacing: -1px;
  margin: 10px 0;
}
h2 {
  font-size: 17px;
  margin: 0;
}
h3 {
  font-size: 14px;
}
p {
  line-height: 1.8;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 27px;
}
.stat {
  padding: 22px 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.stat .label {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.stat strong {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 550;
  display: block;
  margin: 18px 0 10px;
}
.stat small {
  font-size: 14px;
  color: var(--muted);
}
.stat.highlight {
  background: #edf5f1;
  border-color: #dcebe2;
}
.stat.highlight strong {
  color: var(--green);
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.panel-heading {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.scope {
  font-size: 14px;
  color: var(--green);
  background: #edf5f1;
  border-radius: 20px;
  padding: 7px 12px;
}
.toolbar {
  display: flex;
  gap: 12px;
  padding: 0 24px 20px;
  flex-wrap: wrap;
}
.toolbar input {
  min-width: 210px;
  flex: 1;
}
.toolbar input,
.toolbar select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--muted);
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th {
  text-align: left;
  font-size: 14px;
  color: var(--muted);
  background: #fafbfb;
  padding: 14px 24px;
  font-weight: 500;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
td {
  padding: 20px 24px;
  font-size: 14px;
  border-bottom: 1px solid #eef1ef;
}
td small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}
td .link {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 600;
  text-align: left;
  color: var(--ink);
}
tbody tr:hover {
  background: #fbfdfc;
}
.amount {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 550;
}
.status {
  display: inline-block;
  border-radius: 5px;
  padding: 6px 9px;
  font-size: 14px;
  background: #f0f2f3;
  color: var(--muted);
}
.status.pending {
  background: #fbf3e2;
  color: #79520b;
}
.status.issued {
  background: #eaf4ee;
  color: #176145;
}
.status.unknown,
.status.failed {
  background: #faebe7;
  color: #9a3528;
}
.status.rejected {
  background: #f0ebf6;
  color: #684080;
}
.table-foot {
  padding: 16px 24px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}
.note {
  display: flex;
  gap: 14px;
  background: #eef3f1;
  padding: 19px 23px;
  border-radius: 8px;
  margin-top: 23px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.note b {
  color: var(--green);
}
footer {
  margin: 0 38px;
  padding: 23px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 24px;
}
footer b {
  margin-left: auto;
  font-weight: 400;
  letter-spacing: 2px;
}
dialog {
  border: 0;
  border-radius: 13px;
  padding: 0;
  width: 700px;
  max-width: 95vw;
  max-height: 90vh;
  box-shadow: 0 30px 100px #233c3844;
}
dialog::backdrop {
  background: #1c332b66;
  backdrop-filter: blur(3px);
}
.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}
.modal-body {
  padding: 24px 28px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}
.field input,
.field select,
.field textarea {
  border: 1px solid #dfe5e1;
  padding: 11px;
  border-radius: 6px;
  background: white;
  width: 100%;
  color: var(--ink);
}
.full {
  grid-column: 1/-1;
}
.form-section {
  margin: 25px 0 15px;
  font-size: 14px;
  font-weight: 650;
}
.line-item {
  display: grid;
  grid-template-columns: 2fr 0.65fr 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}
.line-item input {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.totals {
  background: #f6f9f7;
  border-radius: 7px;
  padding: 15px;
  line-height: 2;
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}
.modal-actions {
  border-top: 1px solid var(--line);
  padding: 18px 28px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.empty {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.project-card {
  padding: 28px;
}
.project-card p {
  font-size: 14px;
  color: var(--muted);
}
.project-card strong {
  font-size: 26px;
  color: var(--green);
}
.timeline {
  border-left: 2px solid #dbe8e1;
  margin: 22px 4px;
  padding-left: 22px;
}
.timeline p {
  font-size: 14px;
  color: var(--muted);
  margin: 15px 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.detail-grid small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.error {
  color: #b65145;
  font-size: 14px;
  margin: 10px 0;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #234e40;
  color: white;
  padding: 13px 24px;
  border-radius: 8px;
  display: none;
  z-index: 20;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 1050px) {
  aside {
    width: 205px;
  }
  .shell {
    margin-left: 205px;
  }
  main {
    padding: 28px 22px;
  }
  header {
    padding: 0 22px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 19px 15px;
  }
  .stat strong {
    font-size: 24px;
  }
  td,
  th {
    padding: 16px;
  }
  .demo-banner {
    padding: 8px 22px;
  }
}
@media (max-width: 750px) {
  aside {
    position: static;
    width: 100%;
    padding: 15px;
  }
  .brand {
    font-size: 32px;
  }
  .workspace,
  .nav-label,
  .future,
  .aside-bottom {
    display: none;
  }
  nav {
    display: flex;
    margin-top: 15px;
  }
  nav button {
    padding: 9px;
    gap: 6px;
    font-size: 14px;
  }
  .shell {
    margin: 0;
  }
  header {
    height: 61px;
  }
  header > span,
  .demo-pill {
    display: none;
  }
  header > div {
    width: 100%;
    justify-content: space-between;
  }
  .demo-banner {
    line-height: 1.7;
    gap: 10px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .heading {
    gap: 12px;
  }
  h1 {
    font-size: 25px;
  }
  .heading button {
    white-space: nowrap;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  footer span {
    display: none;
  }
  .panel-heading {
    padding: 18px;
  }
  .scope {
    font-size: 14px;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* Production workspace and mobile office layouts */
[hidden] {
  display: none !important;
}
button {
  min-height: 44px;
}
input,
select,
textarea {
  min-height: 44px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #83b9a4;
  outline-offset: 2px;
}
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 20%, #e2eee7, transparent 55%), #f7f9f8;
}
.login-card {
  width: 100%;
  max-width: 490px;
  padding: 44px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px #214e3b09;
}
.login-card .brand {
  margin-bottom: 50px;
}
.login-card h1 {
  font-size: 27px;
  line-height: 1.5;
}
.login-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.login-card button {
  margin: 12px 8px 10px 0;
}
.google-login {
  width: 100%;
  margin-top: 20px !important;
}
.login-foot {
  font-size: 14px;
  border-top: 1px solid var(--line);
  padding-top: 23px;
  margin-top: 22px;
}
#gate-error {
  color: #b65245;
}
.demo-banner {
  line-height: 1.8;
  font-size: 14px;
}
header button {
  padding: 7px 10px;
  font-size: 14px;
}
.status.approved {
  background: #eaf0f8;
  color: #305886;
}
.status.active {
  background: #eaf4ee;
  color: #176145;
}
.status.suspended {
  background: #faebe7;
  color: #9a3528;
}
small {
  overflow-wrap: anywhere;
}
.project-card h2 {
  margin: 18px 0 12px;
  line-height: 1.6;
}
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project-card p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.settings-panel {
  padding: 28px;
  margin-bottom: 22px;
  max-width: 900px;
}
.settings-panel .field {
  margin-top: 25px;
  max-width: 480px;
}
.settings-panel > .subtitle,
.settings-panel form > .subtitle {
  margin-top: 12px;
}
.check-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 23px 0;
}
.check-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.check-list input,
.permission-row input {
  width: 19px;
  height: 19px;
  min-height: 19px;
  accent-color: var(--green);
}
.check-list small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.permission-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.permission-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.permission-row small {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.permission-list {
  margin-top: 18px;
}
.line-item {
  align-items: end;
}
.line-item label {
  font-size: 14px;
  color: var(--muted);
  min-width: 0;
}
.line-item input {
  margin-top: 7px;
}
.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  line-height: 1.8;
  margin: 15px 0;
}
.detail-line span:first-child {
  overflow-wrap: anywhere;
}
.detail-line span:last-child {
  white-space: nowrap;
}
.timeline small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}
.detail-grid > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.modal-top {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}
.modal-actions {
  position: sticky;
  bottom: 0;
  background: white;
  z-index: 2;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.modal-actions:empty {
  display: none;
}
dialog {
  overscroll-behavior: contain;
}
#toast {
  max-width: calc(100vw - 32px);
  width: max-content;
  font-size: 14px;
  line-height: 1.6;
  bottom: max(24px, env(safe-area-inset-bottom));
}
.responsive-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}
.responsive-table td:first-child {
  min-width: 150px;
}
.responsive-table td:last-child {
  white-space: nowrap;
}
#nav {
  overflow-y: auto;
  min-height: 0;
}
#nav button {
  flex-shrink: 0;
}
.field textarea {
  line-height: 1.6;
}
@media (max-width: 750px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .login-card {
    padding: 28px;
  }
  .login-card h1 {
    font-size: 24px;
  }
  .gate {
    padding: 20px;
    align-items: center;
  }
  .login-card .brand {
    margin-bottom: 35px;
  }
  aside {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px 16px 4px;
    border-bottom: 1px solid var(--line);
  }
  aside .brand {
    font-size: 27px;
  }
  aside .brand span {
    font-size: 14px;
  }
  aside .brand small {
    font-size: 14px;
  }
  #nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 5px;
    margin-top: 10px;
    scrollbar-width: none;
  }
  #nav button {
    width: auto;
    min-width: 74px;
    justify-content: center;
    padding: 9px 10px;
    margin: 0;
    gap: 7px;
  }
  #nav button span {
    flex: initial;
  }
  header {
    padding: 0 18px;
    height: 63px;
  }
  header > div {
    gap: 10px;
    justify-content: flex-end;
  }
  #user-name {
    margin-right: auto;
    font-size: 14px;
  }
  .avatar {
    width: 27px;
    height: 27px;
  }
  main {
    padding: 26px 16px;
    min-height: 60vh;
  }
  .demo-banner {
    padding: 10px 18px;
    font-size: 14px;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 23px;
  }
  .heading > button {
    width: 100%;
    font-size: 14px;
    min-height: 46px;
  }
  .heading h1 {
    font-size: 25px;
  }
  .stats {
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat {
    padding: 17px;
  }
  .stat strong {
    font-size: 23px;
    margin: 14px 0 7px;
  }
  .stat small {
    font-size: 14px;
  }
  .panel-heading {
    flex-wrap: wrap;
    gap: 10px;
  }
  .toolbar {
    padding: 0 15px 15px;
    gap: 9px;
  }
  .toolbar input {
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
  }
  .toolbar select {
    flex: 1;
    min-width: 0;
    font-size: 14px;
  }
  .responsive-table,
  .responsive-table tbody {
    display: block;
    width: 100%;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table tr {
    display: block;
    padding: 18px;
    border-bottom: 1px solid var(--line);
  }
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    text-align: right;
    gap: 20px;
    padding: 7px 0;
    border: 0;
    font-size: 14px;
    min-width: 0 !important;
  }
  .responsive-table td:before {
    content: attr(data-label);
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    text-align: left;
    font-weight: 400;
  }
  .responsive-table td:first-child {
    display: block;
    text-align: left;
    padding-bottom: 13px;
  }
  .responsive-table td:first-child:before {
    display: none;
  }
  .responsive-table td:first-child b {
    font-size: 15px;
  }
  .responsive-table td:last-child {
    padding-top: 13px;
  }
  .responsive-table td:last-child:before {
    display: none;
  }
  .responsive-table td:last-child button {
    width: 100%;
    background: #f4f8f6;
    color: var(--green);
  }
  .responsive-table td small {
    display: none;
  }
  .responsive-table td:first-child small {
    display: block;
  }
  .table-foot {
    font-size: 14px;
    line-height: 1.6;
  }
  .project-card {
    padding: 23px;
  }
  .project-actions button {
    flex: 1;
  }
  .cards {
    gap: 16px;
  }
  .settings-panel {
    padding: 22px;
  }
  .settings-panel .field {
    max-width: 100%;
  }
  .settings-panel button[type="submit"] {
    width: 100%;
  }
  .settings-panel h2 {
    font-size: 17px;
  }
  .permission-row {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .permission-row > div {
    grid-column: 1/-1;
  }
  .permission-row label {
    font-size: 14px;
  }
  .note {
    padding: 15px 17px;
    line-height: 1.9;
  }
  footer {
    margin: 0 18px;
    padding: 20px 0;
  }
  dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  dialog form {
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }
  .modal-top {
    padding: 16px 20px;
  }
  .modal-body {
    padding: 22px 20px;
    flex: 1;
  }
  .modal-actions {
    padding: 14px 20px max(14px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .modal-actions button {
    flex: 1;
  }
  .modal-body input,
  .modal-body textarea,
  .modal-body select {
    font-size: 16px;
  }
  .grid {
    gap: 18px;
  }
  .line-item {
    grid-template-columns: 1fr 1fr 42px;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .line-item label:first-child {
    grid-column: 1/-1;
  }
  .line-item button {
    margin-bottom: 0;
  }
  .detail-grid {
    gap: 20px;
    font-size: 14px;
  }
  .detail-line {
    font-size: 14px;
  }
  .detail-line span:last-child {
    font-size: 14px;
  }
  .totals {
    font-size: 14px;
  }
  .empty {
    padding: 35px 22px;
  }
  #main .heading h2 {
    overflow-wrap: anywhere;
  }
  #main .subtitle {
    font-size: 14px;
    line-height: 1.8;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media (max-width: 750px) {
  #nav {
    gap: 3px;
    overflow: visible;
  }
  #nav button {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 8px 2px;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
  }
  #nav button span {
    font-size: 14px;
    white-space: nowrap;
  }
  #nav button i {
    position: absolute;
    right: 3px;
    top: 1px;
    color: #9f6838;
    background: #fff4df;
    border-radius: 9px;
    min-width: 14px;
    font-size: 14px;
  }
}
.stat strong,
.totals strong,
.totals span {
  overflow-wrap: anywhere;
  min-width: 0;
}

/* Readable office UI: body 16px, supporting text 14px, clear contrast. */
button {
  font-weight: 600;
  border-radius: 10px;
  min-height: 48px;
}
input,
select,
textarea {
  min-height: 48px;
  font-size: 16px;
}
input::placeholder,
textarea::placeholder {
  color: #61727d;
  opacity: 1;
}
aside {
  width: 248px;
  padding: 26px 18px;
}
.shell {
  margin-left: 248px;
}
.brand {
  letter-spacing: -2px;
  gap: 10px;
}
.brand small {
  font-size: 10px;
  letter-spacing: 1px;
}
.workspace {
  background: #f5f8fa;
  margin-top: 32px;
  padding: 16px 12px;
}
.workspace span {
  font-size: 16px;
}
nav button {
  color: #475b66;
  font-size: 16px;
  padding: 13px 14px;
}
nav button.active {
  background: #e1f0ea;
  box-shadow: inset 3px 0 #146653;
}
header {
  height: 76px;
  font-size: 15px;
}
header button {
  font-size: 14px;
}
main {
  max-width: 1480px;
  padding: 36px 36px 52px;
}
h1,
.heading h1 {
  font-size: 34px;
  letter-spacing: -0.6px;
  line-height: 1.3;
  margin: 8px 0 12px;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 18px;
}
.subtitle,
#main .subtitle {
  font-size: 16px;
  color: #526570;
  line-height: 1.7;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.5px;
}
.heading {
  margin-bottom: 28px;
}
.stats {
  gap: 16px;
}
.stat {
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 3px 8px #172c3504;
}
.stat .label {
  color: #455e69;
  font-size: 16px;
  font-weight: 600;
}
.stat strong {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  margin: 20px 0 12px;
}
.stat.highlight {
  background: #e4f2ec;
  border-color: #b6d9c9;
}
.panel {
  border-radius: 16px;
  box-shadow: 0 4px 16px #172c3505;
}
.panel-heading {
  padding: 24px;
}
.toolbar input,
.toolbar select {
  color: #233d49;
  font-size: 16px;
  border-color: #cbd7dd;
  border-radius: 9px;
}
th {
  font-size: 14px;
  font-weight: 600;
  color: #475f6a;
  background: #f5f8fa;
}
td {
  font-size: 16px;
  padding: 22px 24px;
}
td small {
  font-size: 14px;
  line-height: 1.6;
}
.amount {
  font-weight: 650;
}
.status {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 7px;
}
.status.issuing {
  color: #79520b;
  background: #fbf3e2;
}
.invoice-environment {
  display: inline-block;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.invoice-environment.sandbox { background: #fff0bd; color: #704300; border: 1px solid #e4a11b; }
.invoice-environment.production { background: #eaf4ee; color: #176145; border: 1px solid #9bcdb2; }
.invoice-detail-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.note,
.demo-banner {
  font-size: 14px;
}
.note {
  background: #e8f0f3;
  color: #395664;
}
.demo-banner {
  background: #fff1d6;
  border-bottom: 1px solid #e9d5a9;
  color: #654919;
}
.field,
.line-item label,
.form-section {
  font-size: 16px;
  color: #354e5b;
}
.field input,
.field select,
.field textarea {
  border-color: #b8c9d1;
  font-size: 16px;
}
.form-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
dialog {
  width: 780px;
  color: var(--ink);
}
.detail-grid,
.detail-line,
.totals,
.permission-row {
  font-size: 16px;
}
.timeline p {
  font-size: 15px;
}
.detail-grid small {
  font-size: 14px;
}
.provider-result {
  background: #e6f4ed;
  border: 1px solid #b6d9c9;
  padding: 20px;
  border-radius: 12px;
  margin: 18px 0;
  overflow-wrap: anywhere;
}
.provider-result strong {
  display: block;
  font-size: 26px;
  margin: 8px 0;
}
.provider-result a {
  color: #105c49;
  font-weight: 650;
}
.error {
  font-size: 15px;
}
@media (max-width: 1100px) and (min-width: 751px) {
  aside {
    width: 220px;
  }
  .shell {
    margin-left: 220px;
  }
  main {
    padding: 28px 22px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  td,
  th {
    padding: 16px;
  }
}
@media (max-width: 750px) {
  aside {
    width: 100%;
    padding: 14px 12px 6px;
  }
  .shell {
    margin-left: 0;
  }
  aside .brand span {
    font-size: 17px;
  }
  aside .brand small {
    font-size: 10px;
  }
  #nav button {
    min-height: 58px;
    padding: 7px 1px;
  }
  #nav button span {
    font-size: 12px;
  }
  #nav button.active {
    box-shadow: inset 0 -3px #146653;
  }
  #user-name {
    font-size: 14px;
  }
  main {
    padding: 24px 16px 36px;
  }
  .heading h1 {
    font-size: 30px;
  }
  .heading > button {
    font-size: 16px;
    min-height: 50px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat {
    padding: 17px 14px;
  }
  .stat .label {
    font-size: 14px;
  }
  .stat strong {
    font-size: 26px;
    margin: 16px 0 10px;
  }
  .stat small {
    font-size: 14px;
  }
  .toolbar select {
    font-size: 16px;
  }
  .responsive-table tr {
    padding: 20px 18px;
  }
  .responsive-table td,
  .responsive-table td:first-child b {
    font-size: 16px;
  }
  .responsive-table td:before {
    font-size: 14px;
  }
  .responsive-table td small,
  .table-foot {
    font-size: 14px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-line,
  .detail-line span:last-child,
  .totals {
    font-size: 16px;
  }
  .detail-line {
    flex-wrap: wrap;
    gap: 6px;
  }
  .modal-actions {
    flex-wrap: wrap;
  }
  .modal-actions button {
    font-size: 15px;
  }
  dialog {
    width: 100vw;
  }
  .permission-row label {
    font-size: 14px;
  }
  .settings-panel h2 {
    font-size: 21px;
  }
}

.provider-result small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

/* AI invoice review: source and editable result remain visible together. */
.ai-entry {
  width: 100%;
  padding: 18px;
  text-align: left;
  background: #e7f4ef;
  border: 1px solid #8cc5b4;
  color: #145b48;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 18px;
}
.ai-entry span {
  display: block;
  font-size: 14px;
  font-weight: 400;
  margin-top: 6px;
}
.ai-dialog {
  width: min(1280px, 96vw);
  max-width: 1280px;
  max-height: 94dvh;
  padding: 0;
  overflow: auto;
}
.ai-dialog .modal-top {
  position: sticky;
  top: 0;
  background: white;
  z-index: 3;
}
.ai-dialog .modal-top small {
  color: #247461;
}
.ai-dialog .modal-top h2 {
  margin: 5px 0;
}
.ai-dialog .modal-actions {
  position: sticky;
  bottom: 0;
  background: white;
  z-index: 3;
  flex-wrap: wrap;
}
.ai-steps {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  overflow-x: auto;
  border-bottom: 1px solid #dce5e1;
}
.ai-steps button {
  flex-shrink: 0;
}
.ai-steps [aria-current="step"] {
  background: #23745f;
  color: white;
}
.ai-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px;
  padding: 24px;
}
.ai-original {
  position: sticky;
  top: 100px;
  align-self: start;
  min-width: 0;
}
.ai-source {
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.9;
  font-size: 16px;
  background: #f6f8f7;
  border: 1px solid #dbe4df;
  border-radius: 10px;
  padding: 20px;
  max-height: 57dvh;
  overflow: auto;
}
.ai-source mark {
  background: #fff1ab;
  color: #25291b;
  border-radius: 2px;
}
.ai-source .source-active {
  background: #bfdbfe;
  color: #172554;
  outline: 2px solid #2563eb;
}
.ai-result {
  min-width: 0;
}
.ai-result fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.ai-result .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ai-result input,
.ai-result select,
.ai-result textarea {
  font-size: 16px;
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
}
.ai-item {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(60px, 0.7fr) minmax(
      80px,
      1fr
    ) 36px;
  gap: 8px;
  align-items: end;
  margin: 14px 0;
}
.ai-item button {
  padding: 8px;
  min-height: 44px;
}
.ai-warnings {
  background: #fff5da;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}
.ai-warnings p {
  margin: 5px 0;
}
.ai-totals {
  background: #ecf5f0;
  padding: 16px;
  line-height: 1.6;
  font-weight: 600;
}
.ai-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
  margin-top: 20px;
}
.ai-confirm input {
  width: 20px;
  min-height: 20px;
  flex-shrink: 0;
}
.ai-progress {
  font-size: 14px;
  color: #456357;
}
.ai-result .field {
  margin-bottom: 12px;
}
@media (max-width: 700px) {
  .ai-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .ai-columns {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 20px;
  }
  .ai-original {
    position: static;
  }
  .ai-source {
    max-height: 26dvh;
    padding: 14px;
  }
  .ai-result .grid {
    grid-template-columns: 1fr;
  }
  .ai-steps {
    padding: 12px 16px;
  }
  .ai-item {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
  }
  .ai-item > .field:first-child {
    grid-column: 1/-1;
  }
  .ai-dialog .modal-actions {
    padding: 12px;
    gap: 8px;
  }
  .ai-dialog .modal-actions button {
    flex: 1;
    min-height: 44px;
  }
  .ai-progress {
    width: 100%;
  }
  .ai-dialog .modal-top {
    padding: 16px;
  }
  .ai-dialog .modal-top h2 {
    font-size: 20px;
  }
}
@media (max-width:700px) {
  .ai-dialog .modal-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ai-dialog .modal-actions button { min-width:0; font-size:14px; }
  .ai-progress { grid-column:1 / -1; }
}
.ai-dialog .ai-steps button { width:auto; flex:0 0 auto; margin:0; padding:10px 14px; }

/* Show provenance without relying on color alone. */
.ai-result .field.ai-inferred > input,
.ai-result .field.ai-inferred > select,
.ai-result .field.ai-inferred > textarea {
  border: 2px solid #c76a0b;
  background: #fff7ed;
}
.ai-field-hint { display: block; font-size: 13px; line-height: 1.5; font-weight: 500; }
.ai-inferred .ai-field-hint { color: #92400e; }
.ai-missing .ai-field-hint, .ai-manual .ai-field-hint { color: #52616b; }
.ai-derived-note { padding: 10px 12px; border: 1px solid #c76a0b; border-radius: 8px; background: #fff7ed; color: #92400e; font-size: 14px; line-height: 1.6; }

.ai-result .field.ai-choice > select {
  border: 2px solid #7c3aed;
  background: #f5f3ff;
}
.ai-choice .ai-field-hint { color: #6d28d9; }
.ai-result .field.ai-suggested > select { border-color: #7c3aed; box-shadow: 0 0 0 4px #ede9fe; }
.ai-suggested .ai-field-hint { color: #5b21b6; font-weight: 700; }

.ai-totals { white-space: pre-line; line-height: 1.8; }
.ai-tax-warning { color: #92400e; background: #fff7ed; border: 1px solid #c76a0b; padding: 12px; border-radius: 8px; }
.ai-calculated .ai-field-hint { color: #52616b; }

/* Compact review while keeping readable type and touch targets. */
.ai-dialog .modal-actions button:disabled {
  background: #e2e8f0; color: #64748b; border: 1px solid #cbd5e1;
  opacity: 1; cursor: not-allowed; box-shadow: none;
}
.ai-result .heading { margin: 0 0 8px; align-items: center; }
.ai-result h3 { font-size: 16px; margin: 8px 0; }
.ai-result .subtitle { font-size: 13px; line-height: 1.5; margin: 5px 0 8px; }
.ai-result .field { margin: 0; gap: 3px; font-size: 14px; }
.ai-result .grid { gap: 8px 12px; }
.ai-field-hint { font-size: 12px; line-height: 1.35; }
.ai-item { margin: 8px 0; align-items: start; }
.ai-item button { margin-top: 22px; }
.ai-result input, .ai-result select, .ai-result textarea { padding: 8px 10px; }
.ai-totals { margin: 6px 0 10px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.ai-confirm { font-size: 14px; margin-top: 10px; gap: 8px; }
.ai-result .error:empty { display: none; }
.ai-result #ai-add-item { padding: 6px 10px; margin: 0; min-height: 36px; font-size: 13px; }
@media (min-width: 1000px) {
  .ai-dialog { width: min(1440px, 97vw); max-width: 1440px; max-height: 97dvh; }
  .ai-columns { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px; padding: 14px 20px; }
  .ai-result .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-dialog .modal-top { padding: 12px 20px; }
  .ai-dialog .modal-top h2 { font-size: 22px; }
  .ai-steps { padding: 8px 20px; }
  .ai-dialog .ai-steps button { padding: 7px 12px; }
  .ai-dialog .modal-actions { padding: 10px 20px; }
  .ai-result input, .ai-result select { min-height: 38px; font-size: 15px; }
  .ai-result textarea { min-height: 38px; }
}
@media (max-width: 700px) {
  .ai-result .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-result .grid .field:has([data-field="email"]) { grid-column: 1 / -1; }
  .ai-columns { gap: 12px; }
}

.ai-remark { margin: 4px 0; font-size: 13px; }
.ai-remark summary { cursor: pointer; padding: 4px 0; color: #52616b; }
.ai-remark[open] summary { margin-bottom: 4px; }
@media (min-width: 1000px) and (max-height: 900px) {
  .ai-dialog .modal-top { padding: 8px 20px; }
  .ai-dialog .modal-top small { display: none; }
  .ai-dialog .modal-top h2 { font-size: 20px; margin: 0; }
  .ai-dialog .modal-top button { min-height: 36px; padding: 6px 10px; }
  .ai-steps { padding: 5px 20px; }
  .ai-dialog .ai-steps button { min-height: 34px; padding: 5px 10px; }
  .ai-columns { padding-top: 8px; padding-bottom: 8px; }
  .ai-result .heading { margin-bottom: 3px; }
  .ai-result h3 { margin: 5px 0; }
  .ai-result .grid { gap: 6px 10px; }
  .ai-totals { padding: 8px 10px; }
}

#integration-note.sandbox-banner { background: #fff0bd; color: #704300; border-bottom: 2px solid #e4a11b; font-size: 15px; font-weight: 650; padding: 12px 24px; }
#integration-note.production-banner { background: #edf6f0; color: #215841; }
.integration-toggle { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.integration-toggle label { flex: 1; min-width: 150px; cursor: pointer; }
.integration-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.integration-toggle span { display: block; border: 2px solid #b8c9d1; border-radius: 8px; padding: 14px; text-align: center; }
.integration-toggle input:checked + span { border-color: #247461; background: #e4f3ec; color: #15503e; font-weight: 700; }
.integration-toggle input:disabled + span { color: #697681; background: #edf0f2; border-color: #d6dce0; cursor: not-allowed; }
.integration-toggle input:focus-visible + span { outline: 3px solid #2563eb; outline-offset: 3px; }

.invoice-project-assignment { border-top: 1px solid #dbe4df; margin-top: 20px; padding-top: 16px; }

.ai-totals { white-space: normal; padding: 8px 12px; }
.ai-total-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 7px 4px; border-radius: 4px; }
.ai-total-row small { font-size: 12px; font-weight: 400; color: #52616b; }
.ai-total-row:hover, .ai-total-row:focus-visible { background: #dbeafe; outline: 1px solid #60a5fa; }
.ai-total-grand { border-top: 1px solid #bed8cb; font-size: 16px; }
.ai-total-mismatch small { color: #9a3412; font-weight: 600; }

.ai-dialog #ai-finish { min-width: 180px; min-height: 48px; }
@media (max-width: 700px) { .ai-dialog #ai-finish { grid-column: 1 / -1; width: 100%; } }

/* Compact workspace density: reduce visual drift while retaining 44px controls. */
@media (min-width: 751px) {
  aside { padding: 18px 14px; }
  .workspace { margin-top: 20px; padding: 9px 8px; }
  .nav-label { margin: 18px 8px 7px; }
  nav button { margin: 2px 0; padding: 9px 11px; }
  .future { margin: 12px 8px; }
  header { height: 64px; padding: 0 24px; }
  main { max-width: 1480px; padding: 20px 24px 28px; }
  .heading { margin-bottom: 14px; }
  .heading h1 { margin: 4px 0 6px; }
  .stats { gap: 10px; margin-bottom: 14px; }
  .stat { padding: 14px 16px; border-radius: 12px; }
  .stat strong { margin: 10px 0 5px; }
  .panel-heading { padding: 14px 16px; }
  .toolbar { gap: 8px; padding: 0 16px 12px; }
  th { padding: 10px 16px; }
  td { padding: 12px 16px; }
  td small { margin-top: 3px; }
  .table-foot { padding: 10px 16px; }
  .note { margin-top: 12px; padding: 10px 14px; line-height: 1.65; }
  .settings-panel { padding: 16px; margin-bottom: 12px; }
  .settings-panel .field { margin-top: 14px; }
  .check-list { gap: 7px; margin: 12px 0; }
  .project-card { padding: 16px; }
  .project-card h2 { margin: 8px 0 5px; }
  .cards { gap: 12px; }
  .provider-result { padding: 12px; margin: 10px 0; }
  .provider-result strong { margin: 4px 0; }
}

dialog { max-height: 94vh; }
.modal-top { padding: 14px 18px; }
.modal-body { padding: 14px 18px; }
.modal-actions { padding: 12px 18px; }
.grid { gap: 10px; }
.field { gap: 5px; }
.form-section { margin: 14px 0 8px; padding-top: 12px; }
.totals { padding: 10px 12px; margin-top: 10px; line-height: 1.65; }
.empty { padding: 30px; }
.timeline { margin: 12px 2px; padding-left: 12px; }
.timeline p { margin: 8px 0; }
.detail-grid { gap: 10px; }
.detail-grid small { margin-bottom: 3px; }

/* Project lifecycle dashboard */
.project-dashboard { max-width: 980px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--green); margin-bottom: 18px; }
.project-dashboard-heading { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; margin-bottom:24px; }
.project-dashboard-heading h1 { margin:7px 0 4px; }
.project-dashboard-heading p { color:var(--muted); margin:0; }
.project-dashboard-actions { display:flex; gap:8px; flex-wrap:wrap; }
.project-kpis { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px; }
.project-kpis > div { border:1px solid var(--line); border-radius:12px; padding:14px 16px; background:#fff; }
.project-kpis small { display:block; color:var(--muted); margin-bottom:5px; }
.project-kpis b { font-size:20px; letter-spacing:-.5px; }
.project-bars { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:0 0 23px; }
.project-bars div > div { display:flex; justify-content:space-between; font-size:13px; color:var(--muted); margin-bottom:7px; }
.project-bars b { color:var(--ink); }
.project-bars i { display:block; height:6px; overflow:hidden; border-radius:99px; background:#e6ecea; }
.project-bars em { display:block; height:100%; border-radius:99px; background:var(--green); }
.project-bars em.payment { background:#4f7d9d; }
.project-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.project-tabs button { background:transparent; border:0; color:var(--muted); padding:10px 12px; border-bottom:2px solid transparent; }
.project-tabs button.active { color:var(--green); border-color:var(--green); font-weight:650; }
.project-data { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px; }
.project-data-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.project-list-head,.project-list-row { display:grid; grid-template-columns:1.3fr .65fr .8fr; gap:12px; align-items:center; border-top:1px solid var(--line); padding:12px 0; }
.project-list-head { color:var(--muted); font-size:12px; padding-top:10px; }
.project-list-row small { display:block; color:var(--muted); margin-top:3px; }
.project-list-row.document { grid-template-columns:1fr auto; }
.project-list-row a { color:var(--green); }
.project-empty { padding:25px 0 8px; color:var(--muted); text-align:center; }
@media(max-width:640px){.project-dashboard-heading{display:block}.project-dashboard-actions{margin-top:14px}.project-kpis,.project-bars{grid-template-columns:1fr}.project-list-head{display:none}.project-list-row{grid-template-columns:1fr auto}.project-list-row span:last-child{display:none}}
.ai-dialog .modal-top { padding: 10px 16px; }
.ai-dialog .modal-actions { padding: 10px 16px; }
.ai-dialog .ai-columns { gap: 12px; }
.ai-dialog .ai-original, .ai-dialog .ai-result { padding: 14px; }

@media (max-width: 750px) {
  main { padding: 14px 12px 22px; }
  .heading { gap: 8px; margin-bottom: 12px; }
  .heading h1 { margin: 2px 0 4px; }
  .stats { gap: 7px; margin-bottom: 12px; }
  .stat { padding: 12px 11px; }
  .stat strong { margin: 8px 0 4px; }
  .panel-heading { padding: 12px; gap: 7px; }
  .toolbar { padding: 0 12px 10px; gap: 7px; }
  .responsive-table tr { padding: 12px; }
  .responsive-table td { padding: 5px 0; gap: 10px; }
  .responsive-table td:first-child, .responsive-table td:last-child { padding-top: 8px; padding-bottom: 8px; }
  .table-foot { padding: 10px 12px; }
  .note { margin-top: 10px; padding: 10px 12px; }
  .modal-top, .modal-body { padding: 12px 14px; }
  .modal-actions { padding: 10px 14px; }
  .detail-grid { gap: 8px; }
  .ai-dialog .ai-original, .ai-dialog .ai-result { padding: 12px; }
}

.cetus-portals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.cetus-portal { padding: 18px; border: 1px solid #cbd8d2; border-radius: 10px; background: #f7faf8; min-width: 0; }
.cetus-portal-sandbox { background: #fff8df; border-color: #e5bf54; }
.cetus-portal h3 { margin: 0 0 10px; }
.cetus-portal p { font-size: 14px; line-height: 1.6; }
.cetus-portal dl { display: grid; grid-template-columns: 48px 1fr; gap: 10px; font-size: 15px; }
.cetus-portal dd { margin: 0; overflow-wrap: anywhere; user-select: all; }
.portal-link { display: inline-flex; min-height: 44px; align-items: center; font-weight: 650; color: #195c49; }
@media (max-width: 700px) { .cetus-portals { grid-template-columns: 1fr; } }

/* Keep the late-loaded integration panels aligned with compact density. */
#integration-note.sandbox-banner { padding: 8px 16px; }
.integration-toggle { gap: 8px; margin: 10px 0; }
.integration-toggle span { padding: 9px; }
.invoice-project-assignment { margin-top: 12px; padding-top: 10px; }
.cetus-portals { gap: 10px; margin-top: 12px; }
.cetus-portal { padding: 12px; }
.cetus-portal h3 { margin-bottom: 5px; }
.cetus-portal dl { gap: 5px; }
@media (max-width: 750px) { #integration-note.sandbox-banner { padding: 8px 12px; } }
.gcp-cost{max-width:1400px;margin:auto}.gcp-status,.gcp-credit{padding:14px 0;color:#52647b;font-size:13px}.gcp-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:end}.gcp-controls label{display:grid;gap:6px;font-size:12px;color:#52647b}.gcp-controls select,.gcp-controls input{padding:10px;border:1px solid #dbe2ec;border-radius:8px;max-width:320px;background:white;min-height:44px}.gcp-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:20px 0 0}.gcp-kpis>div{padding:20px;background:white;border:1px solid #dbe2ec;border-radius:12px;display:grid;gap:12px}.gcp-kpis small{color:#52647b}.gcp-kpis b{font-size:25px;font-variant-numeric:tabular-nums}.gcp-kpis>div:last-child{background:#152d47;color:white}.gcp-kpis>div:last-child small{color:#bbd0e5}.gcp-cost .panel{margin:20px 0}.gcp-cost table{width:100%;border-collapse:collapse;font-size:13px}.gcp-cost th,.gcp-cost td{padding:12px;text-align:right;border-bottom:1px solid #e6ecf3;white-space:nowrap}.gcp-cost th:first-child,.gcp-cost td:first-child{text-align:left;white-space:normal;min-width:180px}.gcp-cost td small{display:block;color:#718096;margin-top:5px}.gcp-chart{padding:18px}.gcp-chart>div{display:grid;grid-template-columns:75px 1fr 120px;gap:12px;align-items:center;margin:10px 0;font-size:12px}.gcp-chart i{height:12px;background:#edf2f8;border-radius:6px;overflow:hidden}.gcp-chart em{height:100%;display:block;background:#286ec6;border-radius:6px}.gcp-chart b{text-align:right}.gcp-cost .table-wrap{overflow:auto}@media(max-width:700px){.gcp-kpis{grid-template-columns:repeat(2,1fr)}.gcp-kpis>div{padding:14px}.gcp-kpis b{font-size:21px}.gcp-controls label{flex:1;min-width:140px}.gcp-controls select{width:100%}.gcp-cost .heading{align-items:start;gap:12px}.gcp-chart>div{grid-template-columns:65px 1fr 90px}.gcp-cost .panel-heading{flex-wrap:wrap}}
.gcp-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:14px;margin-top:20px}.gcp-filter-grid select,.gcp-filter-grid input{width:100%;max-width:none;min-width:0}.gcp-filter-grid label{min-width:0}.gcp-toolbar{display:flex;align-items:center;gap:12px;margin:16px 0}.gcp-toolbar span{flex:1;font-size:12px;color:#637387}.gcp-grid-panel .panel-heading{padding:16px}.gcp-data-grid{max-height:620px;overflow:auto;border-top:1px solid #e4ebf3}.gcp-data-grid table{width:max-content;min-width:100%}.gcp-data-grid thead{position:sticky;top:0;z-index:3;background:#edf3f8}.gcp-data-grid th:first-child,.gcp-data-grid td:first-child{position:sticky;left:0;z-index:1;background:#f7fafc;min-width:150px;max-width:200px}.gcp-data-grid thead th:first-child{z-index:4;background:#edf3f8}.gcp-data-grid td{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gcp-data-grid td:nth-child(2){min-width:180px}.gcp-data-grid td.numeric{font-variant-numeric:tabular-nums;text-align:right}.gcp-data-grid tr:nth-child(even){background:#f8fafc}.gcp-data-grid th button{border:0;background:transparent;padding:4px;font-size:12px;color:#34495f;min-height:32px;white-space:nowrap}.gcp-pagination{display:flex;gap:12px;align-items:center;justify-content:flex-end;padding:14px;font-size:12px}.gcp-pagination label{display:flex;gap:6px;align-items:center}.gcp-pagination select{padding:8px;border:1px solid #dbe2ec;border-radius:8px}.gcp-source-errors{font-size:12px;color:#77571b;background:#fff8e9;border:1px solid #f1dfbb;padding:12px;border-radius:8px}.gcp-source-errors summary,.gcp-secondary summary{cursor:pointer}.gcp-secondary{padding:18px}.gcp-secondary>div{padding-top:16px}.gcp-secondary p{font-size:13px;line-height:1.7;color:#5d6f82}.gcp-secondary h3{font-size:15px;margin-top:24px}.gcp-secondary summary{font-weight:600}.gcp-kpis{margin-top:16px}.gcp-grid-panel .gcp-controls label{font-size:12px}@media(max-width:900px){.gcp-filter-grid{grid-template-columns:repeat(2,minmax(130px,1fr))}.gcp-toolbar{flex-wrap:wrap}.gcp-toolbar span{flex-basis:100%}.gcp-pagination{flex-wrap:wrap;justify-content:start}.gcp-grid-panel .panel-heading{align-items:start}.gcp-data-grid{max-height:520px}}
