* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f5f7f8;
  color: #202a32;
  font:
    14px/1.5 "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
[hidden] {
  display: none !important;
}
#auth-screen {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: #f3f6f5;
}
#auth-screen[hidden] {
  display: none !important;
}
.auth-panel {
  width: min(390px, calc(100% - 32px));
  padding: 30px;
  background: white;
  border: 1px solid #e1e7e5;
  border-radius: 6px;
}
.auth-panel h1 {
  font-size: 22px;
  margin: 5px 0;
}
.auth-panel p {
  color: #738087;
}
.auth-panel label,
.account-form > label {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  color: #4e5d62;
}
.auth-panel input,
.account-form input:not([type="checkbox"]),
.account-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d8e0df;
  border-radius: 4px;
  font: inherit;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 226px;
  padding: 25px 17px;
  background: #172b32;
  color: #e8efed;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 5px;
  background: #18a487;
  color: white;
  font-weight: 800;
}
.brand small {
  display: block;
  color: #91a5a4;
  font-size: 10px;
}
.nav-label,
.eyebrow {
  font-size: 10px;
  letter-spacing: 1px;
  color: #8b989e;
}
.nav-label {
  margin: 40px 10px 12px;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.sidebar nav a {
  color: #c1cdcb;
  text-decoration: none;
  padding: 11px;
  border-radius: 4px;
  cursor: pointer;
}
.sidebar nav a span {
  display: inline-block;
  width: auto;
  margin-right: 7px;
  font-size: 14px;
}
.sidebar nav a.active,
.sidebar nav a:hover {
  background: #29444a;
  color: #fff;
}
.side-bottom {
  display: grid;
  gap: 5px;
  margin-top: auto;
}
.side-action {
  background: none;
  border: 0;
  color: #b9c9c6;
  text-align: left;
  padding: 9px;
  cursor: pointer;
  font: inherit;
}
.workspace {
  margin-left: 226px;
  min-height: 100vh;
}
.topbar {
  height: 58px;
  padding: 0 34px;
  border-bottom: 1px solid #e6e9e9;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7a858a;
  font-size: 12px;
}
.crumb-sep {
  padding: 0 10px;
  color: #c3cacc;
}
.topbar b {
  color: #29343a;
}
.user-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.button {
  height: 37px;
  padding: 0 13px;
  background: white;
  border: 1px solid #d6dedf;
  border-radius: 4px;
  color: #344249;
  cursor: pointer;
  font: inherit;
}
.button:hover {
  background: #f4f8f7;
}
.button.primary {
  background: #087c68;
  color: white;
  border-color: #087c68;
}
.button.primary:hover {
  background: #066956;
}
.button.small {
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
}
.workspace main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 30px 38px 52px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 24px;
}
.page-head h1 {
  margin: 5px 0;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: 0;
}
.page-head p {
  margin: 0;
  color: #78848a;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: white;
  border: 1px solid #e5e9e9;
  border-radius: 4px;
  margin-bottom: 23px;
}
.metrics > div {
  padding: 15px 20px;
  border-right: 1px solid #edf0ef;
}
.metrics > div:last-child {
  border: 0;
}
.metrics span,
.project-stat small,
.project-meta small {
  display: block;
  color: #8a9599;
  font-size: 12px;
}
.metrics b {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  font-weight: 650;
  color: #233139;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid #e1e6e5;
}
.tab {
  padding: 10px 4px;
  border: 0;
  border-bottom: 2px solid #087c68;
  background: none;
  color: #087c68;
  font: inherit;
}
.tab i {
  font-style: normal;
  background: #e6f2ef;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
  font-size: 11px;
}
.toolbar input {
  width: 245px;
  padding: 9px 10px;
  border: 1px solid #dce2e2;
  border-radius: 4px;
  font: inherit;
}
.wage-toolbar {
  justify-content: flex-start;
  gap: 14px;
  padding-bottom: 10px;
}
.wage-toolbar label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #536166;
  font-size: 12px;
}
.wage-toolbar input {
  width: 155px;
}
.wage-toolbar .button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.wage-amount,
.wage-notes {
  min-width: 118px;
  padding: 7px 8px;
  border: 1px solid #d9e0df;
  border-radius: 4px;
  background: #fff;
  color: #29373d;
  font: inherit;
}
.wage-notes {
  min-width: 180px;
}
.personal-valid {
  margin: 0;
  padding: 12px;
  border: 1px solid #e2e8e7;
  border-radius: 4px;
}
.personal-valid legend {
  padding: 0 5px;
  color: #536166;
  font-size: 12px;
}
.personal-valid-list {
  display: grid;
  gap: 8px;
}
.personal-valid-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #536166;
}
.personal-valid-input {
  width: 130px !important;
}
.wage-summary {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #e3e8e7;
  border-radius: 4px;
  background: #fff;
}
.wage-summary h2 {
  margin: 0 0 8px;
  font-size: 16px;
}
.wage-summary-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0ef;
}
.wage-summary-row span {
  color: #647277;
  white-space: normal;
}
.wage-summary-row strong,
.wage-summary-total b {
  color: #087c68;
}
.wage-summary-total {
  padding-top: 12px;
  text-align: right;
  color: #536166;
}
@media (max-width: 620px) {
  .wage-summary-row {
    grid-template-columns: 1fr auto;
  }
  .wage-summary-row span {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
.project-list {
  overflow-x: auto;
  background: white;
  border: 1px solid #e5e9e9;
  border-radius: 4px;
}
.project-row {
  min-width: 1000px;
  min-height: 92px;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(88px, 1fr)) 90px 30px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #edf0ef;
}
.project-row:last-child {
  border: 0;
}
.project-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.project-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #e8f4f0;
  color: #157d68;
  border-radius: 4px;
  font-weight: 700;
  font-size: 17px;
  flex: none;
}
.project-title {
  border: 0;
  background: none;
  padding: 0;
  color: #24333a;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}
.project-title:hover {
  color: #087c68;
}
.project-title span {
  color: #93a19f;
  font-size: 12px;
}
.subline {
  margin-top: 5px;
  color: #828e92;
  font-size: 12px;
}
.project-stat b {
  display: block;
  margin-top: 3px;
  font-weight: 600;
}
.project-meta {
  display: grid;
  justify-items: start;
  gap: 7px;
}
.status {
  font-size: 11px;
  color: #7d8789;
  background: #f0f2f2;
  border-radius: 3px;
  padding: 3px 7px;
}
.status.green {
  color: #218066;
  background: #e7f4ee;
}
.icon-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #718084;
  font-size: 17px;
  cursor: pointer;
}
.icon-button:hover {
  background: #eef4f2;
  color: #087c68;
}
.empty {
  padding: 35px;
  text-align: center;
  color: #8a9599;
}
.back {
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 18px;
  color: #647479;
  cursor: pointer;
  font: inherit;
}
.detail-head {
  margin-bottom: 18px;
}
.detail-head p span {
  padding: 0 7px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1px;
  background: #e5e9e9;
  border: 1px solid #e5e9e9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 30px;
}
.detail-grid > div {
  background: white;
  padding: 14px 17px;
  min-width: 0;
}
.detail-grid label {
  font-size: 11px;
  color: #8b9699;
}
.detail-grid p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.detail-grid small {
  color: #889397;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: 18px;
  margin: 3px 0;
}
.section-head h2 span {
  font-size: 12px;
  font-weight: 400;
  color: #8b9699;
  margin-left: 4px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid #e3e8e7;
  border-radius: 4px;
  background: white;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
th {
  height: 40px;
  background: #f7f9f9;
  color: #79868a;
  font-size: 11px;
  font-weight: 600;
}
td,
th {
  padding: 10px 15px;
  border-bottom: 1px solid #edf0ef;
}
td {
  color: #455258;
}
td b {
  color: #25343b;
  font-weight: 600;
}
tr:last-child td {
  border: 0;
}
.table-wrap .empty {
  white-space: normal;
}
.dialog {
  width: min(590px, calc(100% - 28px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #dfe5e4;
  border-radius: 5px;
  padding: 23px 25px;
  box-shadow: 0 16px 60px #132a302e;
}
.dialog::backdrop {
  background: #14272f66;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.dialog-head h2 {
  font-size: 20px;
  margin: 4px 0;
}
#form-fields {
  display: grid;
  gap: 13px;
}
#form-fields > label,
.form-grid > label {
  display: grid;
  gap: 5px;
  color: #536166;
  font-size: 12px;
}
#form-fields input:not([type="checkbox"]),
#form-fields select,
#form-fields textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d9e0df;
  border-radius: 4px;
  background: #fff;
  color: #29373d;
  font: inherit;
}
#form-fields textarea {
  resize: vertical;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.check-list {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.check-list label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #3d4a50;
}
#auth-error,
#account-error {
  color: #b94040;
}
.form-error {
  min-height: 20px;
  margin-top: 8px;
  color: #b94040;
  font-size: 12px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.account-form {
  min-width: min(460px, 80vw);
}
.account-form h2 {
  margin: 0 0 15px;
  font-size: 20px;
}
.account-row {
  padding: 10px 0;
  border-bottom: 1px solid #edf0ef;
}
.account-row button {
  margin-left: 12px;
  border: 1px solid #d6dedf;
  background: white;
  border-radius: 4px;
  padding: 5px 9px;
  cursor: pointer;
}
.account-projects {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8e7;
  border-radius: 4px;
  padding: 12px;
}
.account-projects label {
  display: flex;
  gap: 7px;
  align-items: center;
}
.account-form > label {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  color: #4e5d62;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  transition: 0.18s;
  background: #233b3c;
  color: white;
  padding: 10px 17px;
  border-radius: 4px;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 850px) {
  .sidebar {
    width: 190px;
  }
  .workspace {
    margin-left: 190px;
  }
  .workspace main {
    padding: 25px 20px;
  }
  .project-row {
    gap: 7px;
    padding: 12px;
  }
  .metrics > div {
    padding: 12px;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 9px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
  }
  .brand {
    font-size: 13px;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  .brand small,
  .nav-label {
    display: none;
  }
  .sidebar nav {
    display: flex;
    margin-left: auto;
    gap: 0;
  }
  .sidebar nav a {
    font-size: 12px;
    padding: 7px;
  }
  .sidebar nav a span {
    width: auto;
    margin-left: 4px;
  }
  .side-bottom {
    display: none;
  }
  .workspace {
    margin: 0;
  }
  .topbar {
    height: 46px;
    padding: 0 12px;
  }
  .workspace main {
    padding: 22px 14px;
  }
  .page-head h1 {
    font-size: 22px;
  }
  .page-head p {
    font-size: 12px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metrics > div:nth-child(2) {
    border-right: 0;
  }
  .metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid #edf0ef;
  }
  .project-row {
    min-width: 1000px;
    gap: 8px;
  }
  .project-main {
    grid-column: auto;
  }
  .project-meta {
    grid-column: auto;
    display: grid;
    align-items: start;
  }
  .project-row .edit-project {
    grid-column: auto;
    grid-row: auto;
  }
  .toolbar input {
    width: 190px;
  }
  .wage-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .wage-toolbar label {
    width: 100%;
  }
  .wage-toolbar input {
    width: 190px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .user-controls {
    gap: 4px;
  }
  .topbar {
    font-size: 11px;
  }
}

/* Keep financial metrics and project columns consistently aligned. */
.metrics {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.metrics > div {
  min-width: 0;
  padding: 15px 14px;
  border-right: 1px solid #edf0ef;
  border-bottom: 0;
}
.metrics > div:nth-child(7) {
  border-right: 0;
}
.metrics > div:last-child {
  grid-column: auto;
}
.metrics b {
  font-size: 20px;
  white-space: nowrap;
}
.project-row {
  min-width: 1080px;
  grid-template-columns: minmax(245px, 2.1fr) repeat(5, minmax(85px, 1fr)) 78px 32px;
  gap: 10px;
  padding: 15px 18px;
}
.project-main > div {
  min-width: 0;
}
.project-title {
  max-width: 100%;
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.subline {
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.project-stat {
  min-width: 0;
}
.project-stat small {
  min-height: 18px;
  line-height: 1.4;
}
.project-stat b {
  line-height: 1.35;
  white-space: nowrap;
}
.project-meta {
  justify-items: center;
  text-align: center;
  white-space: nowrap;
}
@media (max-width: 850px) {
  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .metrics > div:nth-child(4) {
    border-right: 0;
  }
  .metrics > div:nth-child(n + 5) {
    border-top: 1px solid #edf0ef;
  }
  .metrics > div:nth-child(7) {
    grid-column: span 2;
    border-right: 0;
  }
}
@media (max-width: 620px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics > div {
    border-right: 1px solid #edf0ef;
    border-bottom: 1px solid #edf0ef;
  }
  .metrics > div:nth-child(2n) {
    border-right: 0;
  }
  .metrics > div:nth-child(7) {
    grid-column: span 2;
    border-right: 0;
    border-bottom: 0;
  }
}

/* Keep the daily log readable inside the page without horizontal scrolling. */
.daily-log-wrap {
  overflow-x: hidden;
}
.daily-log-table {
  width: 100%;
  table-layout: fixed;
  white-space: normal;
}
.daily-log-table th,
.daily-log-table td {
  padding: 10px 8px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.daily-log-table th:nth-child(1),
.daily-log-table td:nth-child(1) {
  width: 10%;
}
.daily-log-table th:nth-child(2),
.daily-log-table td:nth-child(2) {
  width: 8%;
}
.daily-log-table th:nth-child(3),
.daily-log-table td:nth-child(3) {
  width: 22%;
  white-space: normal;
  line-height: 1.45;
}
.daily-log-table th:nth-child(4),
.daily-log-table td:nth-child(4),
.daily-log-table th:nth-child(5),
.daily-log-table td:nth-child(5),
.daily-log-table th:nth-child(6),
.daily-log-table td:nth-child(6),
.daily-log-table th:nth-child(7),
.daily-log-table td:nth-child(7),
.daily-log-table th:nth-child(8),
.daily-log-table td:nth-child(8) {
  width: 7%;
}
.daily-log-table th:nth-child(9),
.daily-log-table td:nth-child(9),
.daily-log-table th:nth-child(10),
.daily-log-table td:nth-child(10) {
  width: 8%;
}
.daily-log-table th:nth-child(11),
.daily-log-table td:nth-child(11) {
  width: 6%;
  padding-left: 4px;
  padding-right: 4px;
  white-space: nowrap;
}
.daily-log-table .icon-button {
  width: 25px;
  height: 28px;
  padding: 0;
}
@media (max-width: 850px) {
  .daily-log-table th,
  .daily-log-table td {
    padding: 9px 5px;
    font-size: 12px;
  }
  .daily-log-table th:nth-child(1),
  .daily-log-table td:nth-child(1) {
    width: 11%;
  }
  .daily-log-table th:nth-child(2),
  .daily-log-table td:nth-child(2) {
    width: 9%;
  }
  .daily-log-table th:nth-child(3),
  .daily-log-table td:nth-child(3) {
    width: 20%;
  }
  .daily-log-table th:nth-child(4),
  .daily-log-table td:nth-child(4),
  .daily-log-table th:nth-child(5),
  .daily-log-table td:nth-child(5),
  .daily-log-table th:nth-child(6),
  .daily-log-table td:nth-child(6),
  .daily-log-table th:nth-child(7),
  .daily-log-table td:nth-child(7),
  .daily-log-table th:nth-child(8),
  .daily-log-table td:nth-child(8) {
    width: 6.5%;
  }
  .daily-log-table th:nth-child(9),
  .daily-log-table td:nth-child(9),
  .daily-log-table th:nth-child(10),
  .daily-log-table td:nth-child(10) {
    width: 8%;
  }
  .daily-log-table th:nth-child(11),
  .daily-log-table td:nth-child(11) {
    width: 5%;
  }
}
@media (max-width: 620px) {
  .daily-log-table th,
  .daily-log-table td {
    padding: 8px 3px;
    font-size: 11px;
  }
  .daily-log-table th:nth-child(3),
  .daily-log-table td:nth-child(3) {
    width: 18%;
  }
  .daily-log-table th:nth-child(4),
  .daily-log-table td:nth-child(4),
  .daily-log-table th:nth-child(5),
  .daily-log-table td:nth-child(5),
  .daily-log-table th:nth-child(6),
  .daily-log-table td:nth-child(6),
  .daily-log-table th:nth-child(7),
  .daily-log-table td:nth-child(7),
  .daily-log-table th:nth-child(8),
  .daily-log-table td:nth-child(8) {
    width: 7%;
  }
} 

