:root {
  --ink: #142b31;
  --muted: #687b7f;
  --faint: #edf3f1;
  --line: #d9e5e1;
  --paper: #fff;
  --canvas: #f5f8f7;
  --brand: #126e63;
  --brand-dark: #0d504a;
  --brand-soft: #e2f2ed;
  --warning: #996218;
  --warning-soft: #fff4dc;
  --danger: #a84148;
  --success: #20765c;
  --shadow: 0 10px 28px rgba(17, 54, 56, .06);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px, 3vw, 42px); background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; gap: 11px; align-items: center; min-width: 0; }
.brand strong { display: block; font-size: 15px; line-height: 1.2; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.2; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #fff; background: var(--brand); font-weight: 900; }
.brand-light { color: #fff; }
.brand-light small { color: #bad6d1; }
.topbar-user { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.inline-form { display: inline; margin: 0; }
.text-button { border: 0; padding: 0; color: var(--brand); background: none; font-weight: 700; }
.app-shell { display: flex; min-height: calc(100vh - 68px); }
.sidebar { width: 224px; flex: 0 0 224px; padding: 24px 13px; background: #123239; }
.main-nav { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 7px; color: #bed0d1; font-size: 14px; }
.nav-link:hover, .nav-link.active { color: #fff; background: #205158; }
.nav-icon { width: 19px; text-align: center; color: #99c9c0; font-size: 16px; }
.main-content { width: min(1260px, 100%); min-width: 0; flex: 1 1 auto; margin: 0 auto; padding: 34px clamp(17px, 3.6vw, 48px) 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 27px; }
.page-heading h1 { margin: 2px 0 7px; font-size: clamp(24px, 3vw, 31px); line-height: 1.2; letter-spacing: -.02em; }
.page-heading h1 + .muted { margin-top: 0; }
.eyebrow { margin: 0; color: var(--brand); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; font-weight: 800; }
.muted { color: var(--muted); }
.page-heading p, .section-heading p { margin-bottom: 0; }
.heading-actions, .button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--brand); font-size: 13px; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; gap: 7px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.btn-primary { color: #fff; background: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { color: var(--brand-dark); background: var(--brand-soft); border-color: #c7e4dc; }
.btn-secondary:hover { background: #d5ebe5; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-small { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.btn-wide { width: 100%; }
.surface { padding: 21px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-heading h2, .action-card h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.section-heading .muted { margin: 3px 0 0; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 19px; }
.metric-card { min-height: 124px; padding: 19px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: var(--shadow); }
.metric-label { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin: 6px 0 2px; font-size: 29px; line-height: 1.15; }
.metric-card small { color: var(--muted); font-size: 12px; }
.project-list, .quote-list { display: grid; }
.project-row, .quote-row { display: flex; align-items: center; justify-content: space-between; gap: 17px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.project-row:last-child, .quote-row:last-child { border-bottom: 0; }
.project-row:hover, .quote-row:hover { background: #f8fbfa; }
.project-main { display: grid; min-width: 0; gap: 2px; }
.project-main strong, .table-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-code { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.project-meta { display: flex; align-items: center; flex: 0 0 auto; gap: 15px; }
.quote-row > div { display: grid; gap: 2px; min-width: 0; }
.arrow { color: var(--brand); font-size: 18px; }
.status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; color: #536a6e; background: #edf2f1; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-success { color: var(--success); background: #e5f3ed; }
.status-warning { color: var(--warning); background: var(--warning-soft); }
.status-danger { color: var(--danger); background: #fdebed; }
.status-neutral { color: #536a6e; background: #edf2f1; }
.tag { display: inline-flex; padding: 3px 7px; border-radius: 5px; color: var(--brand-dark); background: var(--brand-soft); font-size: 11px; font-weight: 800; white-space: nowrap; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 11px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f5f9f8; font-size: 11px; font-weight: 800; text-align: left; white-space: nowrap; }
td { padding: 12px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.table-link { display: grid; gap: 2px; color: var(--brand-dark); }
.table-sub { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.text-right { text-align: right; }
.empty-cell { padding: 28px 12px; color: var(--muted); text-align: center; }
.empty-state { display: grid; justify-items: center; gap: 5px; padding: 38px 15px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); }
.quote-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 21px; }
.quote-summary > div { display: grid; gap: 4px; min-width: 0; }
.quote-summary strong { font-size: 14px; overflow-wrap: anywhere; }
.quote-summary .total-amount { color: var(--brand); font-size: 20px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.action-card h2 { margin-bottom: 6px; }
.action-card > .muted { margin: 0 0 16px; }
.action-card form { margin-top: 14px; }
.line-input-list { display: grid; gap: 13px; margin-bottom: 13px; }
.line-input { padding: 11px 12px 1px; border: 1px solid var(--line); border-radius: 6px; background: #fbfdfc; }
.line-input > strong { display: block; }
.review-item { padding: 18px 0; border-top: 1px solid var(--line); }
.review-item h3 { margin: 0; font-size: 15px; }
.review-form { margin-top: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field-wide { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12px; font-weight: 800; }
input, select, textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #cbdcd8; border-radius: 6px; outline: 0; color: var(--ink); background: #fff; }
textarea { min-height: 83px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 110, 99, .1); }
.notice { padding: 12px 14px; margin: -8px 0 18px; border-left: 3px solid var(--brand); border-radius: 5px; color: var(--brand-dark); background: var(--brand-soft); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-bottom: 18px; }
.toolbar > select { width: auto; min-width: 140px; }
.toolbar h2 { margin: 0; font-size: 17px; }
.search-form { display: flex; align-items: center; gap: 7px; width: min(440px, 100%); }
.search-form input { min-width: 0; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 17px; }
.flash { padding: 11px 14px; border: 1px solid #c5e3d9; border-radius: 6px; color: var(--brand-dark); background: var(--brand-soft); }
.flash.error { border-color: #efc7ca; color: var(--danger); background: #fff1f2; }
.mobile-nav-toggle { display: none; }
.login-page { min-height: 100vh; background: #123239; }
.login-layout { display: grid; grid-template-columns: minmax(300px, .92fr) minmax(390px, 1.08fr); min-height: 100vh; }
.login-aside { display: flex; flex-direction: column; justify-content: space-between; gap: 35px; padding: clamp(30px, 8vw, 100px) clamp(24px, 6vw, 90px); color: #fff; background: #123239; }
.login-aside-copy { max-width: 420px; margin: auto 0; }
.login-aside-copy h1 { margin: 11px 0 13px; font-size: clamp(30px, 4vw, 48px); line-height: 1.15; letter-spacing: -.035em; }
.login-aside-copy p:last-child { max-width: 330px; margin: 0; color: #bad0cf; font-size: 15px; }
.login-aside-foot { margin: 0; color: #87aaa7; font-size: 12px; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 8vw, 100px); background: #f7faf9; }
.panel-heading { margin-bottom: 25px; }
.panel-heading h2 { margin: 5px 0 5px; font-size: 27px; }
.stack-form { width: min(400px, 100%); }
.stack-form .field { margin-bottom: 16px; }
.login-note { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; width: min(400px, 100%); padding-top: 18px; color: var(--muted); font-size: 12px; }
.login-note code { padding: 3px 6px; border-radius: 4px; color: var(--brand-dark); background: var(--brand-soft); }
.login-switch { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 42px; color: var(--muted); font-size: 12px; }
.login-switch a:hover { color: var(--brand); }
.portal-page { max-width: 1160px; padding: 60px 25px; margin: 0 auto; }
.portal-heading h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.16; letter-spacing: -.03em; margin: 14px 0; }
.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
.portal-card { display: block; padding: 28px; transition: transform .15s, border-color .15s; }
.portal-card:hover { transform: translateY(-3px); border-color: #80b8a9; }
.portal-card h2 { font-size: 21px; margin: 17px 0 8px; }
.portal-symbol { display: inline-grid; width: 44px; height: 44px; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 20px; font-weight: 800; }
.portal-link { display: inline-block; margin-top: 17px; color: var(--brand); font-weight: 800; }
.portal-foot { color: var(--muted); text-align: center; font-size: 12px; margin-top: 23px; }
.form-surface { max-width: 750px; }
.required-mark, .field-error { color: var(--danger); }
.error-surface { max-width: 680px; }
.verification-page { display: grid; place-items: center; min-height: calc(100vh - 68px); padding: 24px; }
.verification-card { width: min(440px, 100%); padding: 30px; }
.verification-card h1 { font-size: 24px; }
.small { font-size: 12px; }
.price-input { min-width: 105px; max-width: 140px; }
input[type="checkbox"] { min-height: auto; width: auto; justify-self: start; }
.attachment-list { display: grid; gap: 9px; margin: 0 0 18px; }
.attachment-list a { color: var(--brand); text-decoration: underline; }
@media (max-width: 900px) {
  .sidebar { width: 188px; flex-basis: 188px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .portal-grid { grid-template-columns: 1fr; gap: 0; }
  .portal-page { padding: 35px 18px; }
  .topbar { height: 62px; }
  .app-shell { display: block; min-height: calc(100vh - 62px); }
  .sidebar { width: 100%; padding: 7px 11px; position: sticky; top: 62px; z-index: 10; }
  .mobile-nav-toggle { display: none; }
  .main-nav { display: flex; width: 100%; overflow-x: auto; gap: 3px; }
  .nav-link { flex: 0 0 auto; padding: 8px 10px; font-size: 12px; }
  .nav-icon { display: none; }
  .main-content { padding: 25px 15px 45px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 21px; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1 1 auto; }
  .metric-card { min-height: 108px; padding: 14px; }
  .metric-card strong { font-size: 24px; }
  .surface { padding: 16px; }
  .project-row, .quote-row { align-items: flex-start; padding: 14px 0; }
  .project-meta { align-items: flex-end; flex-direction: column; gap: 5px; }
  .quote-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .action-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar > select { width: 100%; }
  .search-form { width: 100%; }
  .login-layout { display: block; }
  .login-aside { min-height: 225px; padding: 26px 23px; }
  .login-aside-copy { margin: 15px 0 0; }
  .login-aside-copy h1 { margin: 7px 0; font-size: 29px; }
  .login-aside-copy p:last-child, .login-aside-foot { display: none; }
  .login-panel { min-height: calc(100vh - 225px); padding: 32px 23px 46px; }
}
@media (max-width: 460px) {
  .user-name { display: none; }
  .metric-grid, .form-grid, .form-grid-wide { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .quote-summary { grid-template-columns: 1fr; }
  .project-meta .muted { max-width: 105px; text-align: right; }
}
