/* Jnwecom visual language
   Shared by the staff workspace, customer view and dialogs. */
:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --surface-green: #eef8f4;
  --text: #17221f;
  --ink: #17221f;
  --muted: #66736f;
  --soft: #89948f;
  --line: #e2e9e6;
  --line-strong: #d3ded9;
  --teal: #00876a;
  --teal-dark: #006f58;
  --teal-soft: #e8f5f0;
  --primary: #00876a;
  --primary2: #006f58;
  --green: #00876a;
  --green-soft: #e8f5f0;
  --amber: #c47b15;
  --amber-soft: #fff5e5;
  --red: #c94343;
  --red-soft: #fff0f0;
  --purple: #6d5db2;
  --purple-soft: #f0edfb;
  --slate: #66757c;
  --slate-soft: #edf1f0;
  --shadow: 0 12px 34px rgba(17,55,44,.055);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
body {
  font-family: "Noto Sans SC Variable", "Noto Sans SC", "MiSans", "HarmonyOS Sans SC", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font-family: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(0,135,106,.18);
  outline-offset: 2px;
}

/* Brand marks use the same asset and optical size as Jnwecom. */
.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 6px;
  border: 1px solid #d4e6df;
  border-radius: 12px;
  background: #f7fcfa !important;
  box-shadow: 0 7px 18px rgba(0,110,86,.08) !important;
  color: transparent !important;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Staff shell */
.app-shell { display: block; background: var(--bg); }
.sidebar {
  width: 256px;
  padding: 18px 14px 16px;
  color: var(--text);
  background: rgba(255,255,255,.97);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.brand { min-height: 56px; gap: 11px; padding: 3px 8px 18px; border-bottom: 1px solid var(--line); }
.brand strong { color: #11211d; font-size: 15px; font-weight: 750; letter-spacing: 0; }
.brand small { color: #87938e; font-size: 10px; }
.company-switch {
  margin: 14px 0 8px;
  padding: 10px;
  background: #f5f9f7;
  border: 1px solid #e3ece8;
  border-radius: 12px;
}
.company-switch strong { color: #24332e; }
.company-switch span { color: var(--muted); }
.company-avatar { background: var(--teal-soft); color: var(--teal-dark); }
.nav-list { gap: 3px; padding-top: 7px; }
.nav-item {
  position: relative;
  height: 42px;
  padding: 0 11px;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #5d6965;
  font-weight: 600;
}
.nav-item:hover { color: #20302b; background: #f4f8f6; border-color: #edf1ef; }
.nav-item.active {
  color: #006c55;
  background: #eaf6f1;
  border-color: #d9ece5;
  box-shadow: none;
}
.nav-item.active::before { content: ""; position: absolute; left: -6px; top: 11px; width: 3px; height: 20px; border-radius: 3px; background: var(--primary); }
.nav-item .icon { color: #7a8681; }
.nav-item.active .icon { color: var(--primary); }
.nav-count { background: var(--red-soft) !important; color: var(--red) !important; }
.sidebar-bottom .profile { border-top-color: var(--line); }
.profile strong { color: #22332d; }
.profile span { color: var(--muted); }
.avatar-green { background: var(--teal) !important; }
.main-content { width: calc(100% - 256px); margin-left: 256px; background: var(--bg); }
.topbar {
  height: 82px;
  padding: 0 32px;
  background: rgba(255,255,255,.88);
  border-bottom-color: var(--line);
}
.breadcrumbs { color: var(--muted); }
.breadcrumbs strong { color: var(--text); }
.search-button, .customer-preview { border-color: var(--line-strong); }
.customer-preview { color: var(--primary); }
.customer-preview:hover { border-color: #8ccbb8; }
.icon-button:hover { background: var(--surface-green); color: var(--primary); }

/* Typography, controls and surfaces */
.page-body { max-width: 1480px; padding: 34px 32px 58px; }
.page-header h1, .detail-heading h1 { color: var(--text); font-weight: 750; letter-spacing: -.025em; }
.page-header p, .detail-heading p, .muted { color: var(--muted); }
.eyebrow { color: #7e8b86; letter-spacing: .14em; }
.btn { min-height: 40px; border-radius: 10px; font-weight: 700; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); box-shadow: 0 8px 18px rgba(0,135,106,.18); }
.btn-primary:hover { background: var(--primary2); }
.btn-secondary { color: #34453f; border-color: var(--line-strong); background: #fff; }
.btn-secondary:hover { color: var(--primary2); border-color: #8ccbb8; background: #f8fcfa; }
.text-button, .customer-link { color: var(--primary); }
.text-button:hover, .customer-link:hover { color: var(--primary2); }
input, textarea, select { border-color: var(--line-strong); border-radius: 10px; color: var(--text); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,135,106,.12); }
.panel, .stat-card, .project-card, .customer-table, .material-card, .issue-card, .payment-card {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-heading h3, .section-toolbar h3, .section-heading h3 { color: var(--text); }
.table-head { background: #f8faf9; color: var(--soft); }
.customer-row, .member-row, .payment-row, .material-table-row { border-top-color: var(--line); }
.segmented, .customer-group-tabs { background: #eef3f1; }
.segmented button.active, .customer-group-tabs button.active { color: var(--primary2); }
.progress-track { background: #e9efed; }
.progress-track span, .card-progress .progress-track span, .table-progress .progress-track span { background: var(--primary); }
.detail-tabs { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.detail-tabs::-webkit-scrollbar { display: none; }
.badge-teal, .badge-green { color: var(--primary); }
.badge-red { color: var(--red); }
.badge-amber { color: var(--amber); }
.badge-purple { color: var(--purple); }

/* Project summary and workflow */
.hero-project, .finance-hero {
  background: linear-gradient(120deg, #164d40, #0d765e);
  box-shadow: 0 18px 38px rgba(17,80,61,.14);
}
.hero-side { background: rgba(0,0,0,.12); }
.hero-title-row .text-button { color: #dcf0e8; }
.hero-title-row p, .hero-meta, .side-label, .side-date, .side-note, .finance-hero .eyebrow, .finance-hero span { color: #b4d5c9; }
.hero-meta b { color: #e8f5f0; }
.progress-track span { background: #dff2eb; }
.phase-node.done, .phase-node.active, .detail-phase-row.active strong { color: var(--primary); }
.phase-node.done .phase-dot, .detail-phase-row.done .phase-dot { background: var(--primary); border-color: var(--primary); }
.phase-node.active .phase-dot, .detail-phase-row.active .phase-dot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--teal-soft); }
.timeline-dot, .customer-update-marker > span { border-color: var(--primary); }
.quick-strip { background: #eef7f3; }
.quick-items { grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; }
.attention-item { width: 100%; }
.attention-item > span:nth-child(2) { min-width: 0; }
.attention-item { border-color: var(--line); background: #fbfdfc; }
.attention-item:hover { border-color: #9acdbc; background: #f7fcfa; }
.attention-teal { background: var(--teal-soft); color: var(--primary); }
.risk-indicator em { background: var(--primary); }
.risk-indicator.low em { background: #21a77f; }

/* Customer experience keeps the same system while using warmer whitespace. */
.customer-shell { background: var(--bg); }
.customer-topbar { background: rgba(255,255,255,.94); border-bottom-color: var(--line); }
.customer-brand strong { color: var(--text); }
.customer-brand span { color: var(--muted); }
.customer-avatar { background: var(--primary); }
.customer-hero, .customer-hero.no-photo { background: linear-gradient(120deg, #164d40, #0d765e); box-shadow: 0 18px 38px rgba(17,80,61,.14); }
.customer-hero-image::before { background: linear-gradient(135deg, rgba(20,70,55,.16), rgba(246,237,214,.28)), repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 2px, transparent 2px 85px), linear-gradient(30deg, #899b8f, #d6ddd4 50%, #718a7c); }
.customer-stats, .customer-timeline, .customer-action-card, .customer-help-card { border-color: var(--line); box-shadow: var(--shadow); }
.customer-link { color: var(--primary); }
.customer-help-card { background: #eef7f3; border-color: #d9ebe4; }
.help-mark { color: var(--primary); border-color: #9ccaba; }
.pending-icon.teal { background: var(--teal-soft); color: var(--primary); }

/* Login and dialogs */
.login-shell { background: var(--bg); }
.login-story { background: linear-gradient(145deg, #123a32, #08745c); }
.story-copy h1 { font-size: clamp(36px, 3.75vw, 48px); }
.story-brand .brand-mark, .mobile-brand .brand-mark { width: 42px; height: 42px; }
.story-copy em { color: #9fe1c7; }
.login-panel { background: #fff; }
.login-box form input { background: #fff; }
.demo-hint { background: #eef7f3 !important; border-color: #d9ebe4 !important; color: #55746a !important; }
.hint-dot { background: var(--primary) !important; }
.modal-backdrop { background: rgba(15, 34, 28, .46); }
.modal-dialog { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 70px rgba(12, 45, 35, .2); }
.modal-header { border-bottom-color: var(--line); }
.modal-form label { color: var(--muted); }
.upload-box { border-color: #b9d8cc; background: #f7fcfa; }
.upload-box > span:first-child { background: var(--teal-soft); color: var(--primary); }
.form-hint { background: #f3f7f5; }
.payment-modal-summary { background: var(--teal-soft); }
.payment-modal-summary span, .payment-modal-summary strong { color: var(--primary2); }
.toast-success { background: var(--primary2); }

/* Keep dense operational modules readable as they grow. */
.material-image { background: linear-gradient(135deg, #82988c, #c9d5ce 52%, #61796d); }
.material-card, .issue-card, .payment-card { overflow: hidden; }
.member-status { color: var(--primary) !important; }
.empty-state, .empty-inline { color: var(--muted); }

@media (max-width: 1100px) {
  .sidebar { width: 224px; }
  .main-content { width: calc(100% - 224px); margin-left: 224px; }
  .quick-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-body { padding: 30px 26px 48px; }
}
@media (max-width: 760px) {
  .sidebar { width: 64px; padding: 17px 10px; background: #fff; }
  .main-content { width: calc(100% - 64px); margin-left: 64px; }
  .quick-items { grid-template-columns: minmax(0, 1fr); }
  .brand { padding: 0 4px 25px; border-bottom: 0; }
  .brand > div, .company-switch > div, .company-switch .chevron, .nav-item > span:not(.icon), .profile > div:not(.avatar), .profile .icon-button { display: none; }
  .company-switch { margin: 0 0 18px; padding: 6px; background: transparent; border: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .topbar { height: 64px; padding: 0 14px; }
  .page-body { padding: 24px 14px 44px; }
  .btn, .customer-preview, .nav-item, .icon-button { min-height: 40px; }
  .customer-content { padding: 28px 14px 42px; }
  .customer-topbar { padding: 0 14px; }
  .modal-backdrop { padding: 14px; }
  .modal-dialog { max-height: calc(100dvh - 28px); border-radius: 12px; }
}
@media (max-width: 520px) {
  .topbar { height: 60px; }
  .page-body { padding: 18px 12px 32px; }
  .brand-mark { width: 36px; height: 36px; }
  .hero-main { padding: 22px; }
  .customer-hero.no-photo .customer-hero-copy { padding: 25px 23px; }
}
