.dfxbot-api-workspace-root {
  margin: 0 0 0 -20px;
  color: #111827;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

body.erp-standalone {
  margin: 0;
  overflow-x: hidden;
}

.erp-standalone .dfxbot-api-workspace-root {
  margin: 0;
}

.api-shell {
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  background: #eef2f7;
  transition: grid-template-columns 0.18s ease;
}

.api-nav {
  background: linear-gradient(180deg, #0f172a 0%, #111827 55%, #172033 100%);
  color: #fff;
  padding: 20px 12px;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.nav-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.nav-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-menu-btn,
.mobile-nav-close,
.mobile-nav-backdrop {
  display: none;
}

.brand {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0;
}

.nav-brand-short {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.nav-collapse-btn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(217, 226, 239, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #d9e2ef;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.nav-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.version {
  color: #b7c0ce;
  font-size: 12px;
  margin-bottom: 22px;
}

.api-nav nav {
  display: grid;
  gap: 5px;
}

.nav-group {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(217, 226, 239, 0.18);
}

.nav-module-btn {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  color: #e5edf8;
  text-align: left;
  padding: 11px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-module-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-caret {
  margin-left: auto;
  color: #93c5fd;
  font-size: 11px;
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}

.nav-group.active .nav-module-btn {
  background: rgba(37, 99, 235, 0.24);
  color: #fff;
}

.nav-group.active .nav-caret {
  transform: rotate(0deg);
}

.nav-subnav {
  display: none;
  gap: 4px;
  padding-top: 5px;
}

.nav-group.active .nav-subnav {
  display: grid;
}

.nav-subitem {
  padding-left: 20px;
  font-size: 12.5px;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: #d9e2ef;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-short {
  display: none;
  min-width: 34px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(2px);
}

.nav-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: inset 3px 0 0 #93c5fd;
}

.api-shell.nav-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.api-shell.nav-collapsed .api-nav {
  padding: 18px 8px;
}

.api-shell.nav-collapsed .brand,
.api-shell.nav-collapsed .version,
.api-shell.nav-collapsed .nav-label {
  display: none;
}

.api-shell.nav-collapsed .nav-head {
  justify-content: center;
  flex-wrap: wrap;
}

.api-shell.nav-collapsed .nav-brand-short,
.api-shell.nav-collapsed .nav-short {
  display: flex;
}

.api-shell.nav-collapsed .nav-collapse-btn {
  width: 40px;
}

.api-shell.nav-collapsed .nav-group {
  margin-top: 9px;
  padding-top: 9px;
}

.api-shell.nav-collapsed .nav-module-btn {
  padding: 10px 6px;
  justify-content: center;
}

.api-shell.nav-collapsed .nav-caret {
  display: none;
}

.api-shell.nav-collapsed .nav-subitem,
.api-shell.nav-collapsed .nav-btn {
  padding: 10px 6px;
  justify-content: center;
}

.api-shell.nav-collapsed .nav-btn.active {
  box-shadow: inset 0 -3px 0 #93c5fd;
}

.api-main {
  padding: 22px 28px 32px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.parity-content {
  position: relative;
  min-height: 180px;
}

.notification-bell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notification-bell [data-notification-count] {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.crm-notification-list {
  display: grid;
  gap: 12px;
}

.crm-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.crm-notification > div:first-child {
  display: grid;
  gap: 5px;
}

.crm-notification.overdue {
  border-left: 4px solid #dc2626;
}

@media (max-width: 700px) {
  .crm-notification { align-items: stretch; flex-direction: column; }
}

.parity-content.workspace-loading,
.parity-content.workspace-refreshing {
  isolation: isolate;
}

.parity-content.workspace-loading::before,
.parity-content.workspace-refreshing::before {
  content: "";
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  width: 34%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #2563eb, #38bdf8, transparent);
  animation: workspace-progress 1.05s ease-in-out infinite;
}

.workspace-skeleton {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
}

.workspace-skeleton span {
  display: block;
  height: 46px;
  border-radius: 7px;
  background: linear-gradient(90deg, #eef2f7 20%, #f8fafc 45%, #eef2f7 70%);
  background-size: 240% 100%;
  animation: workspace-shimmer 1.15s linear infinite;
}

.workspace-skeleton span:first-child {
  width: 42%;
  height: 28px;
}

@keyframes workspace-progress {
  from { transform: translateX(-105%); }
  to { transform: translateX(295%); }
}

@keyframes workspace-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .parity-content.workspace-loading::before,
  .parity-content.workspace-refreshing::before,
  .workspace-skeleton span {
    animation: none;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.topbar h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
}

.topbar p {
  margin: 4px 0 0;
  color: #64748b;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.sync-state::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.sync-state.offline {
  background: #fef3c7;
  color: #92400e;
}

.sync-state.offline::before {
  background: #f59e0b;
}
.sync-state.warning{background:#fff4d6;color:#8a5a00}.sync-state.warning::before{background:#f59e0b}

.offline-data-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
  font-weight: 650;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
}

.pagination-row > div {
  display: flex;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 750;
}

.filter-panel {
  background: #fff;
  border: 1px solid #dcdcde;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.filter-field {
  display: grid;
  gap: 4px;
}

.filter-field span {
  font-size: 12px;
  color: #50575e;
  font-weight: 600;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 34px;
}

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

.content-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.2fr) minmax(360px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.content-grid.profile-mode {
  grid-template-columns: 1fr;
}

.content-grid.profile-mode .list-panel {
  display: none;
}

.list-panel,
.detail-panel {
  background: #fff;
  border: 1px solid #dcdcde;
  min-width: 0;
}

.detail-panel {
  padding: 14px;
  position: sticky;
  top: 42px;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.api-table th {
  background: #f0f0f1;
  color: #1d2327;
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #dcdcde;
  white-space: nowrap;
}

.api-table td {
  padding: 8px;
  border-bottom: 1px solid #f0f0f1;
  vertical-align: top;
}

.api-table tbody tr {
  cursor: pointer;
}

.api-table tbody tr:hover {
  background: #f6f7f7;
}

.access-intro p {
  margin: 6px 0 14px;
  color: #475569;
  max-width: 980px;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.access-grid > div {
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.access-grid strong,
.access-grid span {
  display: block;
}

.access-grid span {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.parity-head.compact {
  margin-bottom: 10px;
}

.parity-head.compact h2 {
  margin: 0;
}

.access-table td {
  vertical-align: middle;
}

.access-table label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.access-form {
  margin-bottom: 14px;
}

.form-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.access-role-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.access-role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
}

.access-check {
  font-weight: 500;
}

.access-check.solo {
  font-size: 13px;
}

.compact-form {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.inline-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.inline-control select {
  min-width: 220px;
}

.muted {
  color: #64748b;
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
}

[data-row-screen][data-row-id] {
  cursor: pointer;
}

[data-row-screen][data-row-id]:hover {
  background: #f8fbff;
}

.compact {
  font-size: 12px;
}

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  padding: 10px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.detail-head h2 {
  margin: 0;
  font-size: 18px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.field-cell {
  border: 1px solid #eceff3;
  padding: 8px;
  min-width: 0;
}

.field-cell span {
  display: block;
  font-size: 11px;
  color: #646970;
  margin-bottom: 3px;
}

.field-cell strong {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.profile-view {
  display: grid;
  gap: 14px;
}

.profile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-title h2 {
  margin: 0;
  font-size: 21px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 14px;
}

.profile-card {
  background: #fff;
  border: 1px solid #dbe3ee;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.profile-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.profile-card p {
  margin: 0 0 11px;
}

.profile-card.full {
  width: 100%;
}

.gst-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.totals-card {
  max-width: 560px;
  margin-left: auto;
}

.status,
.lock {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
}

.status {
  background: #e0f2fe;
  color: #075985;
}

.lock.ok {
  background: #ecfdf5;
  color: #047857;
}

.lock.busy {
  background: #fff7ed;
  color: #c2410c;
}

.muted,
.empty-list,
.empty-detail,
.api-loading {
  color: #64748b;
}

.empty-list,
.empty-detail,
.api-loading,
.error-box {
  padding: 18px;
}

.api-loading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-loading::before,
.api-spinner {
  content: "";
  width: 22px;
  height: 22px;
  border: 3px solid #d6e4ff;
  border-top-color: #2563eb;
  border-radius: 50%;
  display: inline-block;
  animation: dfxbot-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.api-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.2);
}

.api-busy-overlay[hidden] {
  display: none;
}

.api-busy-box {
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid #c3c4c7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  font-weight: 700;
}

.api-is-busy {
  cursor: progress;
}

.erp-welcome,.module-landing{background:#fff;border:1px solid #dbe4f0;border-radius:12px;padding:28px;min-height:220px}.module-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px;margin-top:22px}.module-tile{background:#fff;border:1px solid #cdd9e8;border-radius:12px;padding:20px;text-align:left;display:grid;gap:9px;cursor:pointer;color:#10213d;box-shadow:0 4px 12px rgba(16,33,61,.06)}.module-tile:hover{border-color:#2864dc;transform:translateY(-2px);box-shadow:0 8px 20px rgba(40,100,220,.13)}.module-tile .tile-icon{width:48px;height:48px;border-radius:12px;background:#e9f0ff;color:#2459c4;display:grid;place-items:center;font-weight:700}.module-tile strong{font-size:16px}.module-tile small{color:#64748b}.rounding-box{margin:16px 0 16px auto;max-width:520px;padding:14px;border:1px solid #d9e1ec;background:#f8fafc;border-radius:8px}.select-search-input{display:block;width:100%;max-width:520px;margin:0 0 6px;padding:9px 11px;border:1px solid #b9c7da;border-radius:7px;background:#fff}.select-search-input:focus{border-color:#2f6fed;box-shadow:0 0 0 2px rgba(47,111,237,.14);outline:0}select[data-searchable]{width:100%;max-width:520px}

.button.is-processing,
button.is-processing {
  opacity: 0.75;
  cursor: progress !important;
}

@keyframes dfxbot-spin {
  to {
    transform: rotate(360deg);
  }
}

.error-box {
  background: #fcf0f1;
  border: 1px solid #d63638;
  color: #8a2424;
}

.parity-content {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.parity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5edf6;
}

.parity-head h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
}

.parity-toolbar {
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.parity-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.parity-toolbar label span {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.parity-toolbar input,
.parity-toolbar select {
  min-height: 34px;
}

.parity-toolbar > input {
  flex: 1;
  min-width: 260px;
}

.parity-toolbar .description {
  flex-basis: 100%;
  margin: 4px 0 0;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 150px;
}

.table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-scroll > .wp-list-table {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  table-layout: auto;
}

.material-master-table {
  table-layout: fixed !important;
}

.material-master-table th,
.material-master-table td {
  padding: 9px 7px;
  overflow-wrap: anywhere;
}

.material-master-table th:nth-child(1) { width: 10%; }
.material-master-table th:nth-child(2) { width: 4%; }
.material-master-table th:nth-child(3) { width: 7%; }
.material-master-table th:nth-child(4) { width: 10%; }
.material-master-table th:nth-child(5) { width: 20%; }
.material-master-table th:nth-child(6) { width: 4%; }
.material-master-table th:nth-child(7) { width: 5%; }
.material-master-table th:nth-child(8) { width: 6%; }
.material-master-table th:nth-child(9) { width: 8%; }
.material-master-table th:nth-child(10) { width: 4%; }
.material-master-table th:nth-child(11) { width: 22%; }

.material-master-table .action-cell {
  display: table-cell;
  min-width: 0;
}

.material-master-table .action-cell .button {
  margin: 0 4px 5px 0;
  padding: 5px 7px;
  font-size: 12px;
  white-space: normal;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #2271b1;
  cursor: pointer;
  font-weight: 700;
}

.danger {
  color: #b32d2e !important;
  border-color: #b32d2e !important;
}

.wp-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

.wp-list-table th,
.wp-list-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
}

.wp-list-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
}

.wp-list-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.wp-list-table tbody tr:hover {
  background: #eff6ff;
}

.wp-list-table tbody tr:last-child td {
  border-bottom: 0;
}

.button,
button.button,
.page-title-action {
  min-height: 32px;
  border: 1px solid #b8c4d2;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.button:hover,
button.button:hover,
.page-title-action:hover {
  background: #f8fafc;
  border-color: #64748b;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.button-primary,
button.button-primary,
.parity-head .button-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.button-primary:hover,
button.button-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

input,
select,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
  box-shadow: none;
}

input,
select {
  min-height: 34px;
}

textarea {
  padding: 8px 10px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-row > div {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 16px;
  font-size: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.document-preview {
  background: #fff;
  border: 1px solid #dbe3ee;
  padding: 38px;
  max-width: 980px;
  margin: 0 auto;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  font-size: 12px;
  line-height: 1.42;
}

.doc-company {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #2271b1;
  padding-bottom: 18px;
  margin-bottom: 22px;
  gap: 24px;
}

.doc-brand {
  display: grid;
  gap: 10px;
  max-width: 62%;
}

.doc-brand img {
  max-width: 180px;
  max-height: 64px;
  object-fit: contain;
}

.doc-logo-text {
  color: #0ea5d7;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.doc-number {
  text-align: right;
  min-width: 220px;
}

.doc-number h2 {
  margin: 0 0 18px;
  font-size: 24px;
  letter-spacing: 0;
}

.doc-number p {
  margin: 0;
}

.doc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 24px;
}

.doc-item-table {
  font-size: 11px;
}

.doc-item-table th,
.doc-item-table td {
  vertical-align: top;
}

.doc-item-table th:nth-child(n+3),
.doc-item-table td:nth-child(n+3) {
  text-align: right;
  white-space: nowrap;
}

.doc-item-table th:nth-child(2),
.doc-item-table td:nth-child(2) {
  text-align: left;
}

.doc-footer {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 320px);
  gap: 28px;
  margin-top: 18px;
}

.doc-total {
  text-align: right;
  border-top: 1px solid #dbe3ee;
  padding-top: 10px;
}

.serial-book {
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.form-grid input {
  min-height: 34px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #173064, #2563eb);
}

.login-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.login-copy {
  background: #111827;
  color: #fff;
  padding: 42px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.login-brand {
  font-size: 20px;
  font-weight: 700;
}

.login-copy h1 {
  font-size: 40px;
  line-height: 1.12;
  margin: 0;
  max-width: 520px;
}

.login-copy p {
  color: #c7d2fe;
  font-size: 16px;
  max-width: 540px;
}

.login-form {
  padding: 42px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.login-form h2 {
  font-size: 30px;
  margin: 0 0 6px;
}

.login-form label {
  display: grid;
  gap: 5px;
}

.login-form label span {
  color: #50575e;
  font-size: 13px;
  font-weight: 600;
}

.login-form input {
  min-height: 38px;
  border: 1px solid #c3c4c7;
  border-radius: 5px;
  padding: 7px 10px;
}

.login-form button {
  min-height: 42px;
  border: 0;
  border-radius: 5px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.login-message {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  padding: 10px;
  border-radius: 5px;
}

.api-edit-form .form-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.api-edit-form .regular-text {
  width: min(100%, 420px);
}

.api-edit-form h3 {
  border-bottom: 1px solid #e5e7eb;
  margin-top: 24px;
  padding-bottom: 8px;
}

.api-edit-form .form-table th {
  width: 190px;
  color: #475569;
  font-weight: 700;
  padding: 8px 12px 8px 0;
  text-align: left;
  vertical-align: top;
}

.api-edit-form .form-table td {
  padding: 4px 0;
}

.api-edit-form .description {
  color: #64748b;
  font-size: 12px;
}

.doc-lines select,
.doc-lines input {
  width: 100%;
}

.doc-lines .doc-item {
  min-width: 260px;
}

.address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 24px;
}

.address-grid input {
  display: block;
  margin-bottom: 10px;
  width: 100%;
}

.copy-address-row {
  color: #0073aa;
  display: block;
  font-weight: 600;
  margin-bottom: 14px;
}

.readonly {
  background: #f0f0f1;
}

.success-box {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #166534;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
}

.error-box {
  border-radius: 6px;
}

.parity-head > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.link-button {
  font-family: inherit;
}

.link-button:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.dfxbot-api-workspace-root h1,
.dfxbot-api-workspace-root h2,
.dfxbot-api-workspace-root h3,
.dfxbot-api-workspace-root h4,
.dfxbot-api-workspace-root th {
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .dfxbot-api-workspace-root {
    margin: 0;
  }

  body.erp-mobile-nav-open {
    overflow: hidden;
  }

  .api-shell {
    display: block;
    min-height: 100vh;
  }

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

  .api-nav {
    position: fixed;
    z-index: 1200;
    inset: 0 auto 0 0;
    width: min(86vw, 330px);
    box-sizing: border-box;
    padding: calc(16px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.34);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  .api-nav nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .api-shell.mobile-nav-open .api-nav {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    position: fixed;
    z-index: 1190;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.58);
    cursor: default;
  }

  .api-shell.mobile-nav-open .mobile-nav-backdrop {
    display: block;
  }

  .nav-collapse-btn {
    display: none;
  }

  .mobile-nav-close {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(217, 226, 239, 0.25);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-menu-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
  }

  .mobile-menu-btn span {
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .mobile-menu-btn,
  .mobile-nav-close {
    display: inline-flex;
  }

  .nav-module-btn,
  .nav-btn {
    min-height: 48px;
  }

  .nav-group {
    margin-top: 6px;
  }

  .nav-subitem {
    padding-left: 24px;
  }

  .api-shell.nav-collapsed .api-nav {
    padding: calc(16px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
  }

  .api-shell.nav-collapsed .brand,
  .api-shell.nav-collapsed .version,
  .api-shell.nav-collapsed .nav-label {
    display: block;
  }

  .api-shell.nav-collapsed .nav-brand-short,
  .api-shell.nav-collapsed .nav-short {
    display: none;
  }

  .api-shell.nav-collapsed .nav-head {
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .api-shell.nav-collapsed .nav-module-btn,
  .api-shell.nav-collapsed .nav-subitem,
  .api-shell.nav-collapsed .nav-btn {
    padding: 10px 12px;
    justify-content: flex-start;
  }

  .api-shell.nav-collapsed .nav-caret {
    display: inline;
  }

  .detail-panel {
    position: static;
  }

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

  .search-field {
    grid-column: auto;
  }

  .login-panel {
    grid-template-columns: 1fr;
  }

  .login-copy,
  .login-form {
    padding: 28px;
  }

  .login-copy h1 {
    font-size: 30px;
  }

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

  .api-main {
    padding: 0 12px calc(24px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    z-index: 80;
    top: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: calc(58px + env(safe-area-inset-top));
    margin: 0 -12px 12px;
    padding: calc(7px + env(safe-area-inset-top)) 12px 7px;
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.08);
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar h1 {
    overflow: hidden;
    font-size: 18px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar p,
  .user-badge {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .button {
    min-height: 42px;
    padding: 0 10px;
    font-size: 12px;
  }

  .parity-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .parity-toolbar {
    flex-wrap: wrap;
  }

  .parity-toolbar input {
    min-width: min(100%, 280px);
  }

  .wp-list-table {
    display: block;
    overflow-x: auto;
  }

  .document-preview {
    padding: 22px;
  }

  .doc-company,
  .doc-meta,
  .doc-footer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .doc-company {
    display: grid;
  }

  .doc-brand {
    max-width: none;
  }

  .doc-number {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .top-actions [data-install-app],
  .top-actions [data-refresh] {
    display: none;
  }

  .module-tiles {
    grid-template-columns: 1fr;
  }

  .sync-state {
    min-width: 0;
    padding: 0 8px;
    font-size: 0;
  }

  .sync-state::before {
    margin-right: 0;
  }

  .json-data-table,
  .json-data-table tbody,
  .json-data-table tr,
  .json-data-table td {
    display: block;
    width: 100%;
  }

  .json-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .json-data-table tr {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
  }

  .json-data-table td {
    display: grid;
    grid-template-columns: minmax(105px, 40%) minmax(0, 1fr);
    gap: 10px;
    padding: 8px 4px;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    overflow-wrap: anywhere;
  }

  .json-data-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-weight: 750;
  }

  .mobile-card-table-wrap {
    overflow: visible;
  }

  .mobile-card-table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .mobile-card-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .mobile-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .mobile-card-table .mobile-card-header-row {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 12px;
  }

  .mobile-card-table tbody tr {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.04);
  }

  .mobile-card-table tbody td {
    display: grid;
    grid-template-columns: minmax(104px, 38%) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 2px;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    overflow-wrap: anywhere;
    white-space: normal;
    text-align: left;
  }

  .mobile-card-table tbody td:last-child {
    border-bottom: 0;
  }

  .mobile-card-table tbody td::before {
    content: attr(data-label);
    color: #64748b;
    font-weight: 750;
  }

  .mobile-card-table tbody td[data-label=""] {
    display: block;
  }

  .mobile-card-table tbody td[data-label=""]::before {
    content: none;
  }

  .mobile-card-table td .button,
  .mobile-card-table td button,
  .mobile-card-table td a.button {
    width: 100%;
    max-width: 100%;
    margin: 2px 0;
    justify-content: center;
    text-align: center;
  }

  .pagination-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* CRM Phase 1 */
.crm-kanban{display:grid;grid-template-columns:repeat(6,minmax(240px,1fr));gap:14px;overflow-x:auto;padding:4px 2px 18px}.crm-kanban-column{background:#f5f7fb;border:1px solid #d9e1ec;border-radius:12px;padding:12px;min-height:260px}.crm-kanban-column>header{display:flex;flex-direction:column;gap:4px;padding-bottom:10px;border-bottom:1px solid #d9e1ec}.crm-deal-card{display:flex;flex-direction:column;gap:7px;background:#fff;border:1px solid #d9e1ec;border-radius:10px;padding:12px;margin-top:10px;box-shadow:0 2px 5px rgba(15,23,42,.05)}.crm-deal-card .button{align-self:flex-start}.metric-value{font-size:1.8rem;font-weight:700;margin:.35rem 0}.status-pill{display:inline-block;padding:3px 9px;border-radius:999px;background:#eaf2ff;color:#174ea6;font-weight:600}.detail-grid dl{display:grid;grid-template-columns:minmax(110px,.55fr) 1fr;gap:8px 14px}.detail-grid dt{font-weight:700}.detail-grid dd{margin:0;overflow-wrap:anywhere}
@media(max-width:782px){.crm-kanban{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(82vw,320px);scroll-snap-type:x mandatory}.crm-kanban-column{scroll-snap-align:start}.detail-grid dl{grid-template-columns:1fr}.detail-grid dd{margin-bottom:8px}.metric-value{font-size:1.45rem}}
/* Projects ERP portal */
.project-metrics{display:grid;gap:14px;grid-template-columns:repeat(4,minmax(0,1fr));margin:18px 0}.project-metric{background:linear-gradient(145deg,#fff,#f7faff);border:1px solid #dce5f0;border-radius:12px;padding:17px}.project-metric span,.project-metric small{color:#64748b;display:block}.project-metric strong{color:#1769e0;display:block;font-size:25px;margin:7px 0}.project-portal-grid{display:grid;gap:16px;grid-template-columns:repeat(2,minmax(0,1fr))}.project-panel{background:#fff;border:1px solid #dce5f0;border-radius:12px;padding:18px}.project-panel-head{align-items:center;display:flex;justify-content:space-between}.project-panel-head h3{margin:0}.project-list-row{align-items:center;background:transparent;border:0;border-bottom:1px solid #edf1f6;cursor:pointer;display:flex;justify-content:space-between;padding:12px 2px;text-align:left;width:100%}.project-list-row:last-child{border:0}.project-list-row strong,.project-list-row small{display:block}.project-list-row small{color:#718096;margin-top:4px}.project-status{background:#e9eef5;border-radius:999px;color:#475569;display:inline-block;font-size:10px;font-weight:800;padding:4px 8px;text-transform:uppercase;white-space:nowrap}.project-status.active,.project-status.in_progress,.project-status.submitted{background:#ddebff;color:#195da9}.project-status.completed,.project-status.approved{background:#dcf5e6;color:#176c3d}.project-status.blocked,.project-status.cancelled{background:#fde3df;color:#a63125}.project-status.on_hold,.project-status.review{background:#fff0c9;color:#806000}.project-filter{margin-bottom:18px}.project-card-grid{display:grid;gap:14px;grid-template-columns:repeat(3,minmax(0,1fr))}.project-portal-card{background:#fff;border:1px solid #dce5ef;border-radius:12px;padding:17px}.project-portal-card>div:first-child,.project-portal-card footer{align-items:center;display:flex;gap:8px;justify-content:space-between}.project-portal-card h3{margin:15px 0 7px}.project-portal-card p{color:#64748b;height:40px;overflow:hidden}.project-portal-card>small{color:#718096}.project-portal-card footer{justify-content:flex-start;margin-top:15px}.project-number{color:#64748b;font-size:10px;font-weight:800;letter-spacing:.07em}.project-progress{background:#e3eaf3;border-radius:5px;height:6px;margin:14px 0 7px;overflow:hidden}.project-progress i{background:linear-gradient(90deg,#1769e0,#20b8cd);display:block;height:100%}.project-form{background:#fff;border:1px solid #dce5ef;border-radius:12px;padding:20px}.project-form .form-grid{display:grid;gap:15px;grid-template-columns:repeat(2,minmax(0,1fr))}.project-form label>span{color:#475569;display:block;font-weight:600;margin-bottom:6px}.project-form input:not([type=checkbox]),.project-form select,.project-form textarea{max-width:none;width:100%}.project-form .span-2{grid-column:1/-1}.project-form .form-actions{display:flex;gap:8px;margin-top:20px}.project-form .check-field{align-items:center;display:flex;gap:8px}.project-form .check-field span{margin:0}.project-picker{align-items:center;display:flex;gap:10px;margin:0 0 16px}.project-picker span{font-weight:700}.project-picker select{min-width:320px}.project-kanban{display:grid;gap:12px;grid-template-columns:repeat(5,minmax(205px,1fr));overflow:auto;padding-bottom:8px}.project-kanban>section{background:#f2f5f9;border-radius:10px;min-height:220px;padding:10px}.project-kanban>section>header{align-items:center;color:#526176;display:flex;font-size:11px;font-weight:800;justify-content:space-between;padding:4px;text-transform:uppercase}.project-kanban>section>header b{background:#fff;border-radius:999px;padding:2px 7px}.project-kanban article{background:#fff;border:1px solid #dde5ee;border-radius:8px;margin-top:8px;padding:11px}.project-kanban article>div{display:flex;justify-content:space-between}.project-kanban article h4{margin:11px 0 6px}.project-kanban article small{color:#748296;display:block}.project-kanban article select{font-size:11px;margin:10px 0 7px;width:100%}.project-kanban section>p{color:#8491a2;font-size:12px;text-align:center}.priority{background:#e9eef5;border-radius:999px;font-size:9px;font-weight:800;padding:3px 6px;text-transform:uppercase}.priority.high{background:#ffedcf;color:#875300}.priority.critical{background:#fde1dc;color:#9d3024}.project-timeline{border-left:2px solid #dbe5f0;margin:15px 0 0 15px;padding-left:22px}.project-timeline article{margin:0 0 20px;position:relative}.project-timeline article>i{background:#1769e0;border:4px solid #dceaff;border-radius:50%;height:10px;left:-32px;position:absolute;top:4px;width:10px}.project-timeline h3{margin:4px 0}.project-timeline span,.project-timeline p{color:#64748b}.project-audit{margin-top:16px}.project-audit article{align-items:flex-start;border-left:2px solid #dce5ee;display:flex;gap:10px;margin-left:8px;padding:0 0 18px 18px;position:relative}.project-audit article>i{background:#20b8cd;border:3px solid #dff7fa;border-radius:50%;height:8px;left:-6px;position:absolute;top:3px;width:8px}.project-audit small{color:#7b8798;display:block;margin-top:4px}.project-report-title{margin-top:26px}.empty-state{color:#758398;padding:20px;text-align:center}
.project-view-actions{display:flex;flex-wrap:wrap;gap:6px}.project-view-actions .button.active{background:#1769e0;border-color:#1769e0;color:#fff}[data-project-task-panel][hidden]{display:none}.schedule-legend{display:flex;flex-wrap:wrap;gap:18px;margin:15px 0}.schedule-legend span{align-items:center;color:#64748b;display:flex;font-size:12px;gap:6px}.schedule-legend i{border-radius:999px;display:inline-block;height:8px;width:28px}.schedule-legend .planned,.schedule-row .planned{background:#9aa9bb}.schedule-legend .actual,.schedule-row .actual{background:#19a66a}.schedule-legend .forecast,.schedule-row .forecast{background:#ff9e2c}.schedule-gantt{min-width:780px;overflow:auto}.schedule-gantt>header,.schedule-row{align-items:stretch;border-bottom:1px solid #e7edf3;display:grid;grid-template-columns:240px minmax(520px,1fr);min-height:52px}.schedule-gantt>header{color:#64748b;font-size:11px;font-weight:800;min-height:36px;text-transform:uppercase}.schedule-gantt>header>*{padding:10px}.schedule-row>button{padding:8px;text-align:left}.schedule-row>button strong,.schedule-row>button small{display:block}.schedule-row>button small{color:#778599;margin-top:3px}.schedule-row>div{background-image:linear-gradient(90deg,transparent 24.8%,#e8edf3 25%,transparent 25.2%,transparent 49.8%,#e8edf3 50%,transparent 50.2%,transparent 74.8%,#e8edf3 75%,transparent 75.2%);position:relative}.schedule-row>div>i{border-radius:999px;height:8px;position:absolute}.schedule-row>div>.planned{top:12px}.schedule-row>div>.forecast{top:23px}.schedule-row>div>.actual{top:34px}.dependency-summary,.dependency-add{border-top:1px solid #e4eaf1;margin-top:22px;padding-top:18px}.dependency-summary h3,.dependency-add h3{margin-top:0}.dependency-columns{display:grid;gap:16px;grid-template-columns:repeat(2,minmax(0,1fr))}.dependency-columns>div{background:#f6f8fb;border-radius:9px;padding:13px}.dependency-columns h4{margin:0 0 8px}.dependency-columns p{color:#7a8798}.dependency-chip{align-items:center;background:#fff;border:1px solid #dce5ef;border-radius:8px;display:flex;gap:8px;justify-content:space-between;margin:7px 0;padding:9px}.dependency-chip strong,.dependency-chip small{display:block}.dependency-chip small{color:#718096;margin-top:3px}.dependency-add small{color:#718096;display:block;margin-top:4px}.schedule-report-panel{margin-top:18px;overflow:auto}.late-text{color:#b83227;font-weight:700}.project-status.started{background:#ddebff;color:#195da9}.project-status.not_started{background:#eef1f5;color:#596779}
@media(max-width:1100px){.project-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.project-kanban{grid-template-columns:repeat(5,230px)}}

/* Project collaboration, calendar and resource planning */
.project-kanban section[data-project-kanban-status]{transition:background .18s,border-color .18s;border:1px solid transparent}.project-kanban section[data-project-kanban-status]:has(.is-dragging){border-color:#8bb8f5}.project-kanban article[draggable=true]{cursor:grab}.project-kanban article.is-dragging{opacity:.45}.project-kanban section.is-saving{background:#e8f2ff}.project-help{color:#64748b;font-size:12px;margin:8px 0}.project-calendar{display:grid;gap:12px}.project-calendar>section{display:grid;grid-template-columns:180px 1fr;border:1px solid #dce5ef;border-radius:10px;overflow:hidden}.project-calendar time{background:#f3f6fa;font-weight:700;padding:16px}.project-calendar section>div{display:grid;gap:8px;padding:10px}.project-calendar button{align-items:center;background:#fff;border:1px solid #e1e8f0;border-radius:8px;display:grid;grid-template-columns:minmax(260px,1fr) minmax(280px,1fr) auto;gap:10px;padding:10px;text-align:left}.project-calendar button small{color:#64748b}.resource-grid,.project-setup-grid,.task-collaboration{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.resource-meter{background:#e4eaf2;border-radius:6px;height:8px;margin-top:16px;overflow:hidden}.resource-meter i{background:linear-gradient(90deg,#1769e0,#20b8cd);display:block;height:100%}.resource-warning{color:#a63125}.setup-list>div{align-items:center;border-bottom:1px solid #e7edf4;display:flex;justify-content:space-between;padding:10px 0}.setup-list span,.setup-list small{display:block}.setup-list small{color:#64748b;margin-top:3px}.setup-create{display:flex;gap:8px;margin-top:14px}.setup-create input,.setup-create select,.setup-create textarea{min-width:0;flex:1}.setup-create.team{display:grid;grid-template-columns:2fr 1fr 100px auto}.task-collaboration{margin-top:16px}.task-comments article{border-bottom:1px solid #e7edf4;padding:10px 0}.task-comments small{color:#64748b;margin-left:8px}.task-comments p{margin:6px 0}.project-view-actions{display:flex;flex-wrap:wrap;gap:6px}@media(max-width:800px){.resource-grid,.project-setup-grid,.task-collaboration{grid-template-columns:1fr}.project-calendar>section{grid-template-columns:1fr}.project-calendar button{grid-template-columns:1fr}.setup-create.team{grid-template-columns:1fr}}
@media(max-width:782px){.project-metrics,.project-portal-grid,.project-card-grid,.project-form .form-grid,.dependency-columns{grid-template-columns:1fr}.project-form .span-2{grid-column:auto}.project-picker{align-items:flex-start;flex-direction:column}.project-picker select{min-width:0;width:100%}}

/* HR & Payroll portal screens. */
.api-panel,.api-edit-form{background:#fff;border:1px solid #dce5ef;border-radius:12px;padding:20px}
.api-form-grid{display:grid;gap:15px;grid-template-columns:repeat(2,minmax(0,1fr))}
.api-form-grid label>span,.api-edit-form>label>span{color:#475569;display:block;font-weight:650;margin-bottom:6px}
.api-form-grid input:not([type=checkbox]),.api-form-grid select,.api-form-grid textarea,.api-edit-form>label textarea{box-sizing:border-box;max-width:none;width:100%}
.api-form-grid .span-2{grid-column:1/-1}
.api-form-actions,.api-toolbar{align-items:center;display:flex;gap:9px;margin:18px 0}
.api-form-actions{margin-bottom:0}
.api-summary-grid{display:grid;gap:14px;grid-template-columns:repeat(4,minmax(0,1fr));margin:18px 0 24px}
.api-summary-card{background:linear-gradient(145deg,#fff,#f7faff);border:1px solid #dce5f0;border-radius:12px;padding:17px}
.api-summary-card span{color:#64748b;display:block}.api-summary-card strong{color:#1769e0;display:block;font-size:25px;margin-top:7px}
.api-table-wrap{max-width:100%;overflow:auto}.api-table-wrap table{min-width:760px}
@media(max-width:782px){.api-form-grid,.api-summary-grid{grid-template-columns:1fr}.api-form-grid .span-2{grid-column:auto}}

/* Projects interactive Gantt */
.interactive-gantt{background:#fff;border:1px solid #dce5ef;border-radius:12px;overflow:hidden}.gantt-toolbar{align-items:center;background:#f7f9fc;border-bottom:1px solid #dce5ef;display:flex;gap:12px;justify-content:space-between;padding:10px;position:relative}.gantt-toolbar>div{align-items:center;display:flex;gap:6px}.gantt-toolbar .schedule-legend{margin:0}.schedule-legend .critical-key{background:#e24b4b}.gantt-options{background:#fff;border:1px solid #d8e1ec;border-radius:8px;box-shadow:0 10px 28px #15223829;display:grid!important;gap:9px;left:10px;padding:12px;position:absolute;top:48px;z-index:12}.gantt-options[hidden]{display:none!important}.gantt-options label{align-items:center;display:flex;gap:7px;white-space:nowrap}.gantt-shell{display:grid;grid-template-columns:minmax(350px,38%) minmax(0,1fr);max-height:680px;overflow:hidden}.gantt-left{border-right:1px solid #cfd9e5;overflow:hidden;z-index:4}.gantt-left>header{align-items:center;background:#eef3f8;border-bottom:1px solid #ced9e5;display:grid;font-size:11px;font-weight:800;grid-template-columns:1fr 44px;height:52px;padding:0 10px;text-transform:uppercase}.gantt-grid-row{height:54px}.gantt-task-cell{align-items:center;border-bottom:1px solid #e5ebf2;display:flex;height:54px;padding-left:calc(8px + var(--depth)*18px)}.gantt-tree-toggle,.gantt-tree-spacer{align-items:center;background:transparent;border:0;display:flex;height:24px;justify-content:center;padding:0;width:24px}.gantt-tree-toggle{color:#45617d;cursor:pointer;font-size:18px}.gantt-task-link{background:transparent;border:0;cursor:pointer;min-width:0;padding:4px;text-align:left;width:calc(100% - 66px)}.gantt-task-link strong,.gantt-task-link small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gantt-task-link strong{color:#18324d;font-size:12px}.gantt-task-link small{color:#738298;font-size:10px;margin-top:2px}.gantt-percent{font-size:11px;font-weight:700;margin-left:auto;padding-right:8px}.gantt-right{overflow:auto;position:relative}.gantt-calendar{background:#eef3f8;display:flex;height:52px;position:sticky;top:0;z-index:8}.gantt-calendar span{border-right:1px solid #d6e0ea;box-sizing:border-box;color:#596b80;display:flex;flex-direction:column;font-size:10px;justify-content:center;text-align:center}.gantt-calendar span.weekend{background:#e3ebf3}.gantt-calendar b,.gantt-calendar small{display:block}.gantt-milestones{height:0;position:relative;z-index:7}.gantt-milestone{background:transparent;border:0;color:#724800;cursor:default;position:absolute;top:-1px}.gantt-milestone i{background:#ffb020;display:block;height:12px;transform:rotate(45deg);width:12px}.gantt-milestone span{background:#fff7de;border-radius:4px;font-size:9px;left:8px;max-width:120px;overflow:hidden;padding:2px 4px;position:absolute;text-overflow:ellipsis;top:7px;white-space:nowrap}.gantt-timeline{position:relative}.gantt-track{background-image:linear-gradient(to right,#e7edf4 1px,transparent 1px);border-bottom:1px solid #e5ebf2;box-sizing:border-box;height:54px;position:relative}.gantt-links{left:0;overflow:visible;pointer-events:none;position:absolute;top:0;z-index:5}.gantt-links path{fill:none;stroke:#697b8f;stroke-width:1.4}.gantt-links marker path{fill:#697b8f;stroke:none}.gantt-baseline,.gantt-actual{border-radius:999px;height:5px;position:absolute;z-index:2}.gantt-baseline{background:#9aa9bb;top:10px}.gantt-actual{background:#19a66a;bottom:9px}.gantt-current{background:#67b8e9;border-radius:999px;cursor:grab;height:17px;overflow:visible;position:absolute;top:20px;touch-action:none;z-index:6}.gantt-current>i{background:#248ed2;border-radius:999px;display:block;height:100%;pointer-events:none}.gantt-current.critical{box-shadow:0 0 0 2px #e24b4b}.gantt-current.dragging{cursor:grabbing;opacity:.75}.gantt-resize{cursor:ew-resize;height:23px;position:absolute;top:-3px;width:8px}.gantt-resize.start{left:-3px}.gantt-resize.end{right:-3px}.gantt-grid-row.is-overdue .gantt-task-link strong{color:#b83227}.hide-dates .gantt-dates,.hide-assignee .gantt-assignee,.hide-progress .gantt-percent{display:none}.hide-overdue .is-overdue .gantt-task-link strong{color:#18324d}.gantt-help{background:#f8fafc;border-top:1px solid #e4eaf1;color:#63758a;font-size:11px;margin:0;padding:9px 12px}.interactive-gantt:fullscreen{border-radius:0;height:100vh}.interactive-gantt:fullscreen .gantt-shell{max-height:calc(100vh - 105px)}
.gantt-left>header{box-sizing:border-box;position:sticky;top:0;z-index:8}.gantt-task-cell{box-sizing:border-box}.gantt-task-cell.is-overdue .gantt-task-link strong{color:#b83227}.gantt-task-cell.is-pending{background:#fff8e5}.gantt-track.is-pending .gantt-current{outline:2px dashed #f0a020;outline-offset:2px}.gantt-dependency-editor{align-items:end;background:#f8fbff;border-bottom:1px solid #dce5ef;display:grid;gap:10px;grid-template-columns:minmax(170px,1fr) minmax(170px,1fr) minmax(150px,.75fr) minmax(145px,.65fr) auto;padding:12px}.gantt-dependency-editor label{display:grid;gap:5px}.gantt-dependency-editor label>span{color:#53677c;font-size:11px;font-weight:700}.gantt-dependency-editor select,.gantt-dependency-editor input{min-height:36px;width:100%}.gantt-existing-links{align-items:center;display:flex;flex-wrap:wrap;gap:6px;grid-column:1/-1}.gantt-existing-links>span{align-items:center;background:#eaf2fb;border:1px solid #cfdfef;border-radius:999px;color:#28445f;display:inline-flex;font-size:11px;gap:5px;padding:4px 8px}.gantt-existing-links button{background:transparent;border:0;color:#b83227;cursor:pointer;font-size:17px;line-height:1;padding:0}.gantt-toolbar .button.active{background:#2463d4;color:#fff}
@media(max-width:900px){.gantt-toolbar{align-items:flex-start;flex-wrap:wrap}.gantt-toolbar .schedule-legend{order:3;width:100%}.gantt-shell{grid-template-columns:280px minmax(0,1fr)}.gantt-dependency-editor{grid-template-columns:1fr 1fr}.gantt-dependency-editor>.button{align-self:end}.gantt-existing-links{grid-column:1/-1}}

/* Versioned Fast Load settings */
.fast-cache-overlay{align-items:center;background:#0f172ab8;display:flex;inset:0;justify-content:center;padding:20px;position:fixed;z-index:10000}.fast-cache-dialog{background:#fff;border-radius:14px;box-shadow:0 24px 70px #0f172a59;max-height:calc(100vh - 40px);max-width:650px;overflow:auto;padding:22px;width:100%}.fast-cache-head{align-items:flex-start;border-bottom:1px solid #e2e8f0;display:flex;gap:18px;justify-content:space-between;margin-bottom:18px;padding-bottom:14px}.fast-cache-head h2{margin:0}.fast-cache-head p{color:#64748b;margin:5px 0 0}.fast-cache-head>[data-cache-close]{font-size:22px;line-height:1}.fast-cache-toggle{align-items:flex-start;background:#f7faff;border:1px solid #d8e6f5;border-radius:10px;display:flex;gap:12px;padding:14px}.fast-cache-toggle input{height:19px;margin-top:2px;width:19px}.fast-cache-toggle strong,.fast-cache-toggle small{display:block}.fast-cache-toggle small{color:#64748b;margin-top:5px}.fast-cache-limit{display:grid;gap:6px;margin-top:16px}.fast-cache-limit>span{font-weight:700}.fast-cache-limit select{max-width:none;width:100%}.fast-cache-note{background:#fff8e5;border:1px solid #f0d99c;border-radius:9px;margin-top:16px;padding:13px}.fast-cache-note p{color:#66531e;margin:5px 0 0}.fast-cache-status{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.fast-cache-status>span{color:#64748b}.fast-cache-dialog>.form-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:20px}@media(max-width:620px){.fast-cache-overlay{align-items:flex-end;padding:0}.fast-cache-dialog{border-radius:14px 14px 0 0;max-height:92vh}.top-actions [data-cache-settings]{display:none}}
.gantt-cascade-toggle{align-items:center;background:#eaf4ff;border:1px solid #c9dff5;border-radius:7px;color:#294a69;display:inline-flex;font-size:11px;font-weight:700;gap:5px;padding:7px 8px;white-space:nowrap}.gantt-cascade-toggle input{margin:0}
/* CRM decision and workflow controls */
.crm-deal-card[draggable=true]{cursor:grab}.crm-deal-card.is-dragging{opacity:.45}.crm-kanban-column.is-saving{background:#e4f0ff!important;border-color:#6da6ef!important}.crm-score{border-radius:999px;color:#fff;display:inline-block;font-weight:700;min-width:34px;padding:4px 8px;text-align:center}.crm-score.hot{background:#c0392b}.crm-score.warm{background:#d68910}.crm-score.cold{background:#5d6d7e}.crm-activity-calendar{display:grid;gap:12px}.crm-activity-calendar>section{display:grid;grid-template-columns:130px 1fr;border:1px solid #d9e1ec;border-radius:10px;overflow:hidden}.crm-activity-calendar time{background:#f3f6fa;font-weight:700;padding:14px}.crm-activity-calendar section>div{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:10px;padding:10px}.crm-activity-calendar article{border:1px solid #d9e1ec;border-left:4px solid #2f72d6;border-radius:8px;display:flex;flex-direction:column;gap:5px;padding:10px}.crm-activity-calendar article.overdue{border-left-color:#c0392b;background:#fff8f7}.crm-activity-calendar article span,.crm-activity-calendar article small{color:#64748b}@media(max-width:782px){.crm-activity-calendar>section{grid-template-columns:1fr}.crm-activity-calendar section>div{grid-template-columns:1fr}}

.notification-compact{padding:12px 16px!important;margin-bottom:8px!important}.notification-compact h3{font-size:15px;margin:6px 0}.notification-compact p{margin:5px 0;font-size:13px}

/* Authenticated in-app file viewer. */
body.file-preview-open{overflow:hidden}.file-preview-overlay{align-items:center;background:#0f172acc;display:flex;inset:0;justify-content:center;padding:24px;position:fixed;z-index:12000}.file-preview-dialog{background:#fff;border-radius:14px;box-shadow:0 24px 80px #02061780;display:flex;flex-direction:column;height:min(90vh,900px);overflow:hidden;width:min(94vw,1200px)}.file-preview-head{align-items:center;border-bottom:1px solid #dce5ef;display:flex;gap:18px;justify-content:space-between;padding:14px 18px}.file-preview-head h2{font-size:18px;margin:0;max-width:700px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-preview-head p{color:#64748b;margin:4px 0 0}.file-preview-actions{align-items:center;display:flex;gap:8px}.file-preview-actions .button{margin:0}.file-preview-body{align-items:center;background:#e9eef5;display:flex;flex:1;justify-content:center;min-height:0;overflow:auto;padding:14px}.file-preview-body iframe{background:#fff;border:0;height:100%;width:100%}.file-preview-body img{background:#fff;box-shadow:0 5px 22px #0f172a26;max-height:100%;max-width:100%;object-fit:contain}.file-preview-unavailable{background:#fff;border:1px solid #d7e0ea;border-radius:10px;max-width:520px;padding:28px;text-align:center}.file-preview-unavailable p{color:#64748b;margin-bottom:0}@media(max-width:700px){.file-preview-overlay{align-items:stretch;padding:0}.file-preview-dialog{border-radius:0;height:100vh;width:100vw}.file-preview-head{align-items:flex-start;flex-direction:column;padding:12px}.file-preview-head>div:first-child{max-width:100%;width:100%}.file-preview-head h2{font-size:15px;max-width:100%}.file-preview-actions{width:100%}.file-preview-actions .button{flex:1;text-align:center}.file-preview-body{padding:6px}}
.license-banner{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:12px 16px 0;padding:12px 16px;border:1px solid;border-radius:10px}.license-banner.is-read-only{background:#fff7ed;border-color:#fb923c;color:#9a3412}.license-banner.is-locked{background:#fef2f2;border-color:#ef4444;color:#991b1b}.license-banner small{margin-left:auto}.license-lock-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(135deg,#0f172a,#1d4ed8)}.license-lock-card{max-width:620px;padding:36px;border-radius:16px;background:#fff;box-shadow:0 24px 70px rgba(15,23,42,.35)}.license-lock-card h1{margin:18px 0 12px}.license-lock-card p{line-height:1.6;color:#334155}
.saas-metric-grid{display:grid;gap:14px;grid-template-columns:repeat(4,minmax(0,1fr));margin:0 0 18px}.saas-metric-grid article{background:linear-gradient(145deg,#fff,#f7faff);border:1px solid #dce5f0;border-radius:14px;padding:18px;box-shadow:0 8px 22px rgba(15,45,90,.05)}.saas-metric-grid small,.saas-metric-grid span{color:#68778b;display:block}.saas-metric-grid small{font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.saas-metric-grid strong{color:#1769e0;display:block;font-size:30px;line-height:1;margin:10px 0 7px}.saas-customer-list{overflow:visible}.saas-list-head{align-items:end;display:flex;gap:20px;justify-content:space-between;margin-bottom:16px}.saas-list-head h2{margin-bottom:4px}.saas-list-head p{color:#68778b;margin:0}.saas-search{min-width:280px}.saas-search span{display:block;font-size:11px;font-weight:800;margin-bottom:6px;text-transform:uppercase}.saas-search input{width:100%}.saas-state{border-radius:999px;display:inline-block;font-size:10px;font-weight:800;letter-spacing:.04em;padding:5px 9px;text-transform:uppercase}.saas-state.good{background:#dcf5e6;color:#176c3d}.saas-state.warning{background:#fff0c9;color:#806000}.saas-state.danger{background:#fde3df;color:#9d3024}.saas-module-tags{display:flex;flex-wrap:wrap;gap:4px}.saas-module-tags span{background:#edf4ff;border:1px solid #d4e4fb;border-radius:999px;color:#285b91;font-size:10px;font-weight:700;padding:4px 7px}.saas-row-actions{display:flex;flex-wrap:wrap;gap:6px;min-width:190px}.saas-dialog{background:transparent;border:0;max-height:92vh;max-width:760px;padding:0;width:calc(100% - 30px)}.saas-dialog.wide{max-width:1050px}.saas-dialog::backdrop{background:rgba(5,18,38,.68);backdrop-filter:blur(3px)}.saas-dialog-shell{background:#fff;border:1px solid #d7e1ed;border-radius:16px;box-shadow:0 28px 80px rgba(5,20,50,.35);max-height:92vh;overflow:auto}.saas-dialog-shell>header{align-items:center;background:linear-gradient(135deg,#0d1b35,#163c76);color:#fff;display:flex;justify-content:space-between;padding:20px 24px;position:sticky;top:0;z-index:3}.saas-dialog-shell>header small{color:#9fc3ee;display:block;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.saas-dialog-shell>header h2{color:#fff;margin:4px 0 0}.saas-dialog-close{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.3);border-radius:50%;color:#fff;cursor:pointer;font-size:24px;height:38px;line-height:30px;width:38px}.saas-dialog-body{padding:0}.saas-commercial-form{padding:22px 24px 26px}.saas-commercial-form section{border-bottom:1px solid #e4eaf2;margin-bottom:20px;padding-bottom:18px}.saas-commercial-form section h3{color:#17324f;margin:0 0 14px}.saas-commercial-form fieldset{border:1px solid #d9e3ef;border-radius:12px;margin:0 0 20px;padding:16px}.saas-commercial-form legend{font-weight:800;padding:0 7px}.saas-context-strip{align-items:center;background:#f1f6fd;border:1px solid #d8e6f7;border-radius:10px;color:#53677f;display:flex;flex-wrap:wrap;gap:8px 24px;margin-bottom:20px;padding:13px 15px}.saas-context-strip strong{color:#17324f}.saas-module-grid{display:grid;gap:10px;grid-template-columns:repeat(4,minmax(0,1fr))}.saas-module-option{align-items:center;background:#f8fafc;border:1px solid #dce5ef;border-radius:9px;cursor:pointer;display:flex;gap:9px;padding:12px}.saas-module-option:has(input:checked){background:#eaf3ff;border-color:#75a9e9;color:#174f8d}.saas-module-option input{margin:0}.saas-inline-actions{display:flex;gap:7px;margin-top:12px}.saas-confirm{align-items:flex-start;background:#fff8e7;border:1px solid #f0d18c;border-radius:10px;display:flex;gap:10px;margin:18px 0;padding:13px}.saas-confirm input{margin-top:3px}.saas-confirm span{color:#624d1e;line-height:1.45}.saas-commercial-form .api-form-message{color:#9d3024;font-weight:700}.saas-commercial-form [hidden]{display:none!important}
@media(max-width:980px){.saas-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.saas-module-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.saas-list-head{align-items:stretch;flex-direction:column}.saas-search{min-width:0}}
@media(max-width:600px){.saas-metric-grid{grid-template-columns:1fr 1fr}.saas-metric-grid article{padding:14px}.saas-module-grid{grid-template-columns:1fr}.saas-dialog{width:calc(100% - 16px)}.saas-dialog-shell>header,.saas-commercial-form{padding-left:16px;padding-right:16px}.saas-row-actions{min-width:0}.saas-row-actions .button{flex:1 1 auto}}

/* Unified live and historical invoice register. */
.historical-register-notice{align-items:flex-start;background:#f5f0ff;border:1px solid #d9c8f5;border-radius:10px;color:#4b3275;display:flex;gap:12px;margin-bottom:16px;padding:13px 15px}.historical-register-notice strong{white-space:nowrap}.historical-register-notice span{line-height:1.45}.record-source{border-radius:999px;display:inline-block;font-size:10px;font-weight:800;letter-spacing:.035em;padding:5px 9px;text-transform:uppercase;white-space:nowrap}.record-source.live{background:#dcf5e6;color:#176c3d}.record-source.historical{background:#eee6ff;color:#59358c}.historical-invoice-banner{align-items:flex-start;background:linear-gradient(135deg,#f8f4ff,#eef5ff);border:1px solid #d8caee;border-radius:12px;display:flex;gap:15px;margin-bottom:16px;padding:17px 18px}.historical-invoice-banner strong{color:#33224d}.historical-invoice-banner p{color:#5d5270;margin:5px 0 0}.historical-invoice-summary dl{display:grid;gap:13px 22px;grid-template-columns:repeat(4,minmax(0,1fr));margin:0}.historical-invoice-summary dl>div{border-bottom:1px solid #e8e2f1;padding-bottom:10px}.historical-invoice-summary dt{color:#697386;font-size:11px;font-weight:800;letter-spacing:.035em;text-transform:uppercase}.historical-invoice-summary dd{font-weight:650;margin:5px 0 0;overflow-wrap:anywhere}.historical-link-note{background:#fff8e7;border:1px solid #efd99f;border-radius:8px;color:#67531f;margin:17px 0 0;padding:11px 13px}
@media(max-width:900px){.historical-invoice-summary dl{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.historical-register-notice,.historical-invoice-banner{flex-direction:column}.historical-invoice-summary dl{grid-template-columns:1fr}}

.saas-metric-grid{display:grid;gap:14px;grid-template-columns:repeat(4,minmax(0,1fr));margin:0 0 18px}.saas-metric-grid article{background:linear-gradient(145deg,#fff,#f7faff);border:1px solid #dce5f0;border-radius:14px;padding:18px;box-shadow:0 8px 22px rgba(15,45,90,.05)}.saas-metric-grid small,.saas-metric-grid span{color:#68778b;display:block}.saas-metric-grid small{font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.saas-metric-grid strong{color:#1769e0;display:block;font-size:30px;line-height:1;margin:10px 0 7px}.saas-customer-list{overflow:visible}.saas-list-head{align-items:end;display:flex;gap:20px;justify-content:space-between;margin-bottom:16px}.saas-list-head h2{margin-bottom:4px}.saas-list-head p{color:#68778b;margin:0}.saas-search{min-width:280px}.saas-search span{display:block;font-size:11px;font-weight:800;margin-bottom:6px;text-transform:uppercase}.saas-search input{width:100%}.saas-state{border-radius:999px;display:inline-block;font-size:10px;font-weight:800;letter-spacing:.04em;padding:5px 9px;text-transform:uppercase}.saas-state.good{background:#dcf5e6;color:#176c3d}.saas-state.warning{background:#fff0c9;color:#806000}.saas-state.danger{background:#fde3df;color:#9d3024}.saas-module-tags{display:flex;flex-wrap:wrap;gap:4px}.saas-module-tags span{background:#edf4ff;border:1px solid #d4e4fb;border-radius:999px;color:#285b91;font-size:10px;font-weight:700;padding:4px 7px}.saas-row-actions{display:flex;flex-wrap:wrap;gap:6px;min-width:190px}.saas-dialog{background:transparent;border:0;max-height:92vh;max-width:760px;padding:0;width:calc(100% - 30px)}.saas-dialog.wide{max-width:1050px}.saas-dialog::backdrop{background:rgba(5,18,38,.68);backdrop-filter:blur(3px)}.saas-dialog-shell{background:#fff;border:1px solid #d7e1ed;border-radius:16px;box-shadow:0 28px 80px rgba(5,20,50,.35);max-height:92vh;overflow:auto}.saas-dialog-shell>header{align-items:center;background:linear-gradient(135deg,#0d1b35,#163c76);color:#fff;display:flex;justify-content:space-between;padding:20px 24px;position:sticky;top:0;z-index:3}.saas-dialog-shell>header small{color:#9fc3ee;display:block;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.saas-dialog-shell>header h2{color:#fff;margin:4px 0 0}.saas-dialog-close{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.3);border-radius:50%;color:#fff;cursor:pointer;font-size:24px;height:38px;line-height:30px;width:38px}.saas-dialog-body{padding:0}.saas-commercial-form{padding:22px 24px 26px}.saas-commercial-form section{border-bottom:1px solid #e4eaf2;margin-bottom:20px;padding-bottom:18px}.saas-commercial-form section h3{color:#17324f;margin:0 0 14px}.saas-commercial-form fieldset{border:1px solid #d9e3ef;border-radius:12px;margin:0 0 20px;padding:16px}.saas-commercial-form legend{font-weight:800;padding:0 7px}.saas-context-strip{align-items:center;background:#f1f6fd;border:1px solid #d8e6f7;border-radius:10px;color:#53677f;display:flex;flex-wrap:wrap;gap:8px 24px;margin-bottom:20px;padding:13px 15px}.saas-context-strip strong{color:#17324f}.saas-module-grid{display:grid;gap:10px;grid-template-columns:repeat(4,minmax(0,1fr))}.saas-module-option{align-items:center;background:#f8fafc;border:1px solid #dce5ef;border-radius:9px;cursor:pointer;display:flex;gap:9px;padding:12px}.saas-module-option:has(input:checked){background:#eaf3ff;border-color:#75a9e9;color:#174f8d}.saas-module-option input{margin:0}.saas-inline-actions{display:flex;gap:7px;margin-top:12px}.saas-confirm{align-items:flex-start;background:#fff8e7;border:1px solid #f0d18c;border-radius:10px;display:flex;gap:10px;margin:18px 0;padding:13px}.saas-confirm input{margin-top:3px}.saas-confirm span{color:#624d1e;line-height:1.45}.saas-commercial-form .api-form-message{color:#9d3024;font-weight:700}.saas-commercial-form [hidden]{display:none!important}
@media(max-width:980px){.saas-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.saas-module-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.saas-list-head{align-items:stretch;flex-direction:column}.saas-search{min-width:0}}
@media(max-width:600px){.saas-metric-grid{grid-template-columns:1fr 1fr}.saas-metric-grid article{padding:14px}.saas-module-grid{grid-template-columns:1fr}.saas-dialog{width:calc(100% - 16px)}.saas-dialog-shell>header,.saas-commercial-form{padding-left:16px;padding-right:16px}.saas-row-actions{min-width:0}.saas-row-actions .button{flex:1 1 auto}}

/* Visible fallback scrolling and compact expense records. */
.table-scroll-controls{display:flex;align-items:center;gap:8px;margin:8px 0;max-width:100%;min-width:0}
.table-scroll-controls[hidden]{display:none!important}
.table-scroll-controls>.button{flex:none;min-width:38px}
.table-scroll-top{overflow-x:auto;overflow-y:hidden;min-width:0;flex:1;height:22px;scrollbar-gutter:stable;background:#f1f5fa;border:1px solid #dbe3ee;border-radius:5px}
.table-scroll-top>div{height:1px}
.table-scroll:focus-visible,.table-scroll-top:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.expense-list-wrap{container-type:inline-size}
.table-scroll>.expense-list-table{table-layout:fixed;width:100%;min-width:0}
.expense-list-table th,.expense-list-table td{overflow-wrap:anywhere;white-space:normal;vertical-align:top;padding:10px 8px}
.expense-list-table th:nth-child(1){width:8%}.expense-list-table th:nth-child(2){width:12%}.expense-list-table th:nth-child(3){width:13%}.expense-list-table th:nth-child(4){width:9%}.expense-list-table th:nth-child(5){width:14%}.expense-list-table th:nth-child(6){width:9%}.expense-list-table th:nth-child(7){width:12%}.expense-list-table th:nth-child(8){width:12%}.expense-list-table th:nth-child(9){width:11%}
.expense-list-table .action-cell{display:table-cell;min-width:0}
.expense-cell-value{min-width:0;max-width:100%;overflow-wrap:anywhere}
.expense-list-table td button,.expense-list-table td .button,.expense-list-table td a{max-width:100%;white-space:normal;overflow-wrap:anywhere;height:auto}
.expense-list-table .action-cell .button{margin:0 3px 6px 0;padding:6px 8px}
.expense-list-table td:nth-child(7) button{display:inline-block;margin:0 3px 5px 0}
.table-scroll.mobile-card-table-wrap{overflow-x:auto}
@container (max-width:1000px){
  .expense-list-table,.expense-list-table tbody,.expense-list-table tbody tr{display:block;width:100%;min-width:0}
  .expense-list-table{border:0;background:transparent}
  .expense-list-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .expense-list-table tbody{display:grid;gap:12px}
  .expense-list-table tbody tr{border:1px solid #dbe3ee;border-radius:10px;padding:8px 14px;background:#fff}
  .expense-list-table tbody td{display:grid;grid-template-columns:minmax(130px,25%) minmax(0,1fr);gap:12px;border:0;border-bottom:1px solid #eef2f7;padding:9px 0;width:100%}
  .expense-list-table tbody td::before{content:attr(data-label);font-weight:700;color:#64748b}
  .expense-list-table tbody td:last-child{border:0}
  .expense-list-table tbody td[data-label=""]{display:block}.expense-list-table tbody td[data-label=""]::before{content:none}
}
@media(max-width:600px){
  .expense-list-table tbody td{grid-template-columns:minmax(95px,34%) minmax(0,1fr);gap:8px}
  .expense-list-table tbody tr{padding:8px 10px}
  .expense-list-table td .button,.expense-list-table td button{width:auto;text-align:left}
}

/* Fit ordinary lists first. Floating controls are reserved for genuine overflow. */
.table-scroll>.comfort-fit-table{table-layout:fixed;width:100%;min-width:0;max-width:100%}
.comfort-fit-table th,.comfort-fit-table td{min-width:0;white-space:normal;overflow-wrap:anywhere}
.comfort-fit-table td button,.comfort-fit-table td .button,.comfort-fit-table td a{max-width:100%;white-space:normal;overflow-wrap:anywhere;height:auto}
@media(min-width:701px){.comfort-fit-table .action-cell{display:table-cell;min-width:0}.comfort-fit-table .action-cell .button{margin:0 4px 5px 0}}
.table-scroll.has-horizontal-overflow{margin-bottom:70px}
.table-scroll-controls{position:fixed;bottom:12px;z-index:1000;box-sizing:border-box;margin:0;padding:7px 10px;border:1px solid #bccce1;border-radius:10px;background:#fff;box-shadow:0 4px 20px #0f172a33;display:flex;align-items:center;gap:8px;max-width:calc(100vw - 16px)}
.table-scroll-caption{font-size:12px;font-weight:600;white-space:nowrap}
.table-scroll-top{height:24px;min-width:30px;scrollbar-gutter:auto}
@media(max-width:600px){.table-scroll-caption{display:none}.table-scroll-controls{padding:6px;gap:5px}.table-scroll-controls>.button{min-height:34px}}

.select-search-results{display:block;color:#64748b;font-size:12px;margin:5px 0}.select-search-results[hidden]{display:none!important}

/* GRN quality/stores entry: wrap desktop cells, stack mobile lines. */
.grn-decision-card,.grn-decision-card *{box-sizing:border-box}
.grn-decision-card .grn-decision-table{width:100%;table-layout:fixed;border-collapse:collapse}
.grn-decision-card td,.grn-decision-card th{padding:10px;text-align:left;overflow-wrap:anywhere;white-space:normal}
.grn-decision-card input[type=number],.grn-decision-card input[name=storage_location],.grn-decision-card textarea{width:100%;min-width:0;max-width:100%}
.grn-decision-card textarea{resize:vertical}
.grn-decision-card .submit{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:640px){.grn-decision-card{padding:10px}.grn-decision-card form{padding:10px}.grn-decision-table thead{display:none}.grn-decision-table tbody,.grn-decision-table tr{display:block;width:100%}.grn-decision-table tr{border:1px solid #dbe3ee;border-radius:8px;margin-bottom:10px}.grn-decision-table td{display:grid;grid-template-columns:minmax(0,42%) minmax(0,1fr);gap:10px}.grn-decision-table td:before{content:attr(data-label);font-weight:650}.grn-decision-table input{min-width:0}}

.payment-workflow label{display:block;margin-bottom:14px}.payment-workflow input,.payment-workflow select,.payment-workflow textarea{display:block;width:100%;max-width:620px}.money-table{table-layout:fixed;width:100%}.money-table td,.money-table th{overflow-wrap:anywhere;white-space:normal}.money-table button{white-space:normal;max-width:100%}@media(max-width:760px){.money-table thead{display:none}.money-table tr{display:block;border-bottom:1px solid #ddd;padding:12px}.money-table td{display:block;width:auto;padding:6px}.money-table td:before{font-weight:bold;display:block}.money-table td:nth-child(1):before{content:"Date / Reference"}.money-table td:nth-child(2):before{content:"Party"}.money-table td:nth-child(3):before{content:"Amount / Available"}.money-table td:nth-child(4):before{content:"Status"}}

.inline-supplier-add { margin: .4rem 0 .2rem .5rem; vertical-align: middle; }
.inline-supplier-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow-y: auto; border: 1px solid #dbe4ef; border-radius: 12px; padding: 20px; color: #172b45; }
.inline-supplier-dialog::backdrop { background: rgba(15,23,42,.6); }
.inline-supplier-dialog header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.inline-supplier-dialog h2 { margin:0; }
.inline-supplier-dialog form, .inline-supplier-dialog input, .inline-supplier-dialog select, .inline-supplier-dialog textarea { max-width:100%; box-sizing:border-box; }
.inline-supplier-dialog label { display:block; }
.inline-supplier-dialog .submit { display:flex; gap:8px; flex-wrap:wrap; }
@media(max-width:600px) { .inline-supplier-dialog { padding:14px; } .inline-supplier-add { display:block; margin-left:0; } }

.live-import-dialog{width:min(960px,calc(100vw - 24px));max-height:90vh;overflow:auto;border:1px solid #d7e1ec;border-radius:12px;padding:20px;box-sizing:border-box;color:#17273f;background:#fff}
.live-import-dialog::backdrop{background:rgba(13,28,52,.55)}
.live-import-title{display:flex;justify-content:space-between;gap:12px;align-items:center;position:sticky;top:-20px;background:#fff;padding:12px 0;z-index:2}
.live-import-title h2{margin:0}.live-import-dialog label{display:block;margin:12px 0}.live-import-dialog button{padding:8px 12px;margin:4px;border:1px solid #bbcbe0;border-radius:5px;background:#f8fbff;cursor:pointer}.live-import-dialog button:disabled{opacity:.5;cursor:wait}.live-import-dialog select,.live-import-dialog input[type=file]{max-width:100%}.live-import-dialog p{line-height:1.5;overflow-wrap:anywhere}.live-import-dialog [data-import-message]{color:#244b87;font-weight:600;margin:12px 0;overflow-wrap:anywhere}.live-import-row{border:1px solid #dae4ef;padding:12px;border-radius:8px;overflow-wrap:anywhere;margin:10px 0}.live-import-row label{margin:0 0 6px}.live-import-row p{margin:4px 0}.live-import-state{font-weight:600;margin-top:5px}.live-import-tools{display:flex;gap:8px;flex-wrap:wrap}

.material-adjustment{border:1px solid #b7791f;border-radius:6px;padding:12px;margin:10px 0;background:#fffbeb}.material-adjustment pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit}.material-row-edit textarea{width:100%;min-height:100px;box-sizing:border-box}.material-row-edit select{max-width:100%;width:100%}

dialog.material-import-dialog[open]{display:flex;flex-direction:column;overflow:hidden;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px)}
.material-import-dialog>.live-import-title{position:static;flex-shrink:0;padding:6px 0}
.material-import-dialog>p:not([data-message]){max-height:72px;overflow-y:auto;flex-shrink:0;margin:6px 0}
.material-import-dialog>[data-message]{max-height:48px;overflow-y:auto;flex-shrink:0;margin:4px 0}
.material-import-dialog>[data-body]{min-height:64px;overflow-y:auto;overscroll-behavior:contain;flex:1;padding-right:6px}
.material-submit-bar{flex:0 0 auto;border-top:2px solid #d7e1ec;background:#fff;padding:8px 0 0;max-height:50vh;max-height:50dvh;overflow-y:auto;overflow-wrap:anywhere}
.material-submit-bar label{margin:6px 0;font-size:14px;line-height:1.3}.material-submit-bar [data-selection-summary]{margin:4px 0;font-weight:600}
.material-submit-bar [data-submit-message]{margin:6px 0;color:#174f88;font-weight:600;max-height:84px;overflow-y:auto;overflow-wrap:anywhere}
.material-submit-bar [data-commit]{min-height:40px;font-weight:600}
@media(max-width:500px){dialog.material-import-dialog{padding:12px}.material-import-dialog .live-import-title h2{font-size:18px}.material-submit-bar label{font-size:13px}}

/* Material preview: prioritize row space while keeping actions in view. */
dialog.material-import-dialog[open]{width:calc(100vw - 24px);max-width:1480px;height:calc(100vh - 24px);height:calc(100dvh - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);padding:12px 16px;font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.35}
.material-import-dialog>.live-import-title{padding:0;gap:12px;min-height:36px}
.material-import-dialog>.live-import-title h2{font-size:20px;line-height:1.25}
.material-import-dialog>p:not([data-message]){font-size:13px;line-height:1.35;margin:4px 0 8px;max-height:54px}
.material-import-dialog:has(>.material-submit-bar)>[data-message]{display:none}
.material-import-dialog>[data-body]{min-height:80px;padding-right:6px}
.material-import-dialog .live-import-row{padding:10px;margin:6px 0}
.material-import-dialog .material-submit-bar{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;padding:6px 0 0;max-height:40vh;max-height:40dvh}
.material-import-dialog .material-submit-bar [data-selection-summary]{flex:1 0 100%;margin:0;font-size:13px;line-height:1.3}
.material-import-dialog .material-submit-bar label{display:flex;align-items:flex-start;gap:6px;flex:1 1 220px;margin:0;font-size:13px;line-height:1.3}
.material-import-dialog .material-submit-bar input[type=checkbox]{flex:none;margin:2px 0 0;width:16px;height:16px}
.material-import-dialog .material-submit-bar [data-commit]{flex:0 1 auto;margin:0;min-height:36px;padding:7px 10px;font-size:13px;white-space:normal}
.material-import-dialog .material-submit-bar [data-submit-message]{flex:1 0 100%;margin:0;font-size:13px;line-height:1.3;max-height:48px}
.material-import-dialog .material-submit-bar [data-submit-message]:empty{display:none}
@media(max-width:600px){dialog.material-import-dialog[open]{width:calc(100vw - 12px);height:calc(100vh - 12px);height:calc(100dvh - 12px);max-height:calc(100vh - 12px);max-height:calc(100dvh - 12px);padding:10px}.material-import-dialog>.live-import-title h2{font-size:18px}.material-import-dialog .material-submit-bar{gap:6px}.material-import-dialog .material-submit-bar label{flex-basis:100%}.material-import-dialog .material-submit-bar [data-commit]{width:100%}}

.erp-list-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:8px;margin:6px 0;border:1px solid #d7e1ec;border-radius:6px;background:#f6f9fd;font-size:13px}.erp-list-tools [role=status]{flex:1 0 100%;overflow-wrap:anywhere}.erp-list-tools button{font-size:13px}.erp-list-select{display:inline-flex;vertical-align:middle;margin-right:7px;align-items:center}.erp-list-select input{width:17px;height:17px;cursor:pointer}dialog.erp-list-decision{width:min(900px,calc(100vw - 20px));max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto;padding:18px;border:1px solid #bbcbe0;border-radius:10px;font:14px/1.4 Arial,Helvetica,sans-serif;color:#17273f}dialog.erp-list-decision::backdrop{background:rgba(13,28,52,.55)}.erp-list-decision h2{font-size:20px;margin:0 0 8px}.erp-list-review{max-height:30vh;overflow:auto;border:1px solid #d7e1ec;padding:6px}.erp-list-review p{margin:5px 0;overflow-wrap:anywhere}.erp-list-decision label{display:block;margin:10px 0}.erp-list-decision textarea{display:block;box-sizing:border-box;width:100%;margin-top:4px}.erp-list-confirm{display:flex!important;gap:7px;align-items:flex-start}.erp-list-dialog-actions{display:flex;flex-wrap:wrap;gap:6px}.erp-list-decision [data-progress]{overflow-wrap:anywhere;white-space:pre-wrap}.erp-list-tools [hidden],.erp-list-decision [hidden]{display:none!important}

dialog.erp-list-decision[open]{display:flex;flex-direction:column;overflow:hidden;max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);padding:0}
.erp-list-decision-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:12px 16px;border-bottom:1px solid #d7e1ec;background:#fff}.erp-list-decision-head h2{margin:0}.erp-list-decision-head button{flex:none;min-height:36px}
.erp-list-decision-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 16px 10px}.erp-list-decision-body [data-plan]{margin:10px 0}.erp-list-decision-body .erp-list-review{max-height:28vh;max-height:28dvh}
.erp-list-decision-foot{flex:none;background:#fff;border-top:1px solid #d7e1ec;padding:10px 16px;max-height:35vh;max-height:35dvh;overflow-y:auto}.erp-list-decision-foot [data-progress]{margin:6px 0 0;max-height:72px;overflow-y:auto}.erp-list-tools [data-export-access]{font-size:12px;color:#52657a}
@media(max-width:600px){.erp-list-decision-head,.erp-list-decision-foot{padding:10px}.erp-list-decision-head h2{font-size:17px}.erp-list-decision-body{padding:0 10px 8px}.erp-list-decision-body .erp-list-review{max-height:24vh;max-height:24dvh}}

.server-page-controls{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;border:1px solid #d7e1ec;border-radius:7px;background:#f6f9fd;padding:10px;margin:8px 0 16px;font-size:13px}.server-page-controls strong{flex:1 1 280px}.server-page-controls label{display:flex!important;align-items:center;gap:5px;margin:0!important}.server-page-controls select{width:auto;min-width:65px}.server-page-controls .server-page-buttons{display:flex;gap:5px;align-items:center;flex-wrap:wrap}.server-page-controls input[type=number]{width:75px;min-width:0}.server-page-controls [role=status]{flex-basis:100%;overflow-wrap:anywhere}.server-page-controls .select-search-input{max-width:160px}.server-page-controls button{font-size:13px}.server-page-note{font-size:13px;color:#52657a}

[data-voice-panel]{width:min(680px,calc(100vw - 24px));max-height:88dvh;box-sizing:border-box;overflow:auto;border:1px solid #94a3b8;border-radius:12px;padding:20px;color:#172033;background:#fff;box-shadow:0 18px 65px #0f172a55}
[data-voice-panel]::backdrop{background:#0f172a88}
[data-voice-panel] .voice-head{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:-20px;background:white;z-index:2;padding:8px 0}
[data-voice-panel] h2{margin:0}[data-voice-panel] p{overflow-wrap:anywhere}
[data-voice-panel] label{display:block;margin:10px 0;font-size:14px}
[data-voice-panel] select,[data-voice-panel] textarea{display:block;width:100%;box-sizing:border-box;padding:9px;border:1px solid #94a3b8;border-radius:6px;background:white;color:#172033}
[data-voice-panel] input[type=checkbox]{width:auto;display:inline-block}
[data-voice-panel] .voice-options{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
[data-voice-panel] button{padding:9px 12px;margin:4px 4px 4px 0;border:1px solid #64748b;border-radius:6px;background:#f1f5f9;color:#172033;cursor:pointer;min-height:40px}
[data-voice-panel] button:disabled{opacity:.5;cursor:default}
[data-voice-panel] [data-v=status]{padding:10px;background:#edf4ff;border-radius:6px}
[data-voice-panel] [hidden]{display:none!important}
[data-voice-panel] details{margin-top:14px}[data-voice-panel] summary{cursor:pointer}
@media(max-width:480px){[data-voice-panel]{padding:14px}[data-voice-panel] .voice-options{grid-template-columns:1fr}}
