:root {
  --navy: #1a2040;
  --blue: #0066cc;
  --light-blue: #eaf5ff;
  --border: #d9e1e8;
  --text: #202936;
  --muted: #667085;
  --surface: #ffffff;
  --page: #f5f7fa;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --disabled: #eef1f4;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--page);
}

a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .72; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.brand-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(26, 32, 64, .08);
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

h1, h2 { color: var(--navy); }
h1 { margin: 7px 0 8px; }
h2 { margin: 0 0 6px; }
p { color: var(--muted); }

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, .10);
}

button {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.secondary-button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 12px;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.form-message, .status-message {
  min-height: 20px;
  margin: 0;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.error { color: var(--danger); }

.version-mark {
  margin-top: 18px;
  color: #98a2b3;
  font-size: 11px;
}

.app-shell {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 26px;
}

.topbar h1 { margin-bottom: 4px; }
.page-subtitle { margin: 0; }

.user-box {
  text-align: right;
  display: grid;
  justify-items: end;
  gap: 4px;
}

.user-name { font-weight: 700; color: var(--navy); }
.user-meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading p { margin: 0; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.active-module:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(26, 32, 64, .08);
}

.disabled-module { opacity: .72; }

.module-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--light-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.module-content strong {
  display: block;
  color: var(--navy);
  font-size: 17px;
  margin-bottom: 6px;
}

.module-content small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.module-action {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.module-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--disabled);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.view-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(170px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.checkbox-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.checkbox-field input {
  width: 17px;
  min-height: 17px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.summary-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  display: block;
  margin-top: 5px;
  color: var(--navy);
  font-size: 21px;
}

.table-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.table-scroll { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf0f3;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--navy);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .025em;
}

.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.negative-row { background: var(--danger-bg); }
.negative-row .number-cell { color: var(--danger); font-weight: 700; }

@media (max-width: 900px) {
  .module-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .user-box { text-align: left; justify-items: start; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 22px, 1480px); }
  .toolbar { grid-template-columns: 1fr; }
  .brand-card { padding: 24px; }
  .module-card { grid-template-columns: auto minmax(0, 1fr); }
  .module-action, .module-badge { grid-column: 2; justify-self: start; }
  .view-actions { flex-direction: column; }
}


/* ============================================================
   Production Entry — v0.7
   ============================================================ */

textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  resize: vertical;
  font: inherit;
}

textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, .10);
}

.form-card,
.entry-header-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.production-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.wide-field {
  grid-column: 1 / -1;
}

.optional-text {
  color: var(--muted);
  font-weight: 400;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

.info-note,
.warning-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.warning-note {
  background: #fff8e7;
  color: #7a5a00;
}

.compact-heading {
  margin-bottom: 16px;
}

.compact-heading p {
  margin: 0;
}

.entry-header-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 12px;
}

.entry-header-card h2 {
  margin: 5px 0;
}

.entry-header-card p {
  margin: 0;
}

.status-pill,
.negative-badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--light-blue);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.negative-badge {
  margin-top: 4px;
  background: var(--danger-bg);
  color: var(--danger);
}

.review-actions,
.post-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.post-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.consumption-table td strong,
.consumption-table td small {
  display: block;
}

.consumption-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.actual-cell {
  min-width: 130px;
}

.actual-cell input {
  min-width: 110px;
}

@media (max-width: 700px) {
  .production-form {
    grid-template-columns: 1fr;
  }

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

  .entry-header-card,
  .review-actions,
  .post-actions {
    flex-direction: column;
  }

  .review-actions button,
  .post-actions button {
    width: 100%;
  }
}


/* ============================================================
   Production Complete Module — v0.8
   ============================================================ */

.production-toolbar {
  align-items: flex-end;
}

.toolbar-actions,
.entry-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(260px, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.search-field {
  max-width: 520px;
}

.production-history-table td strong,
.production-history-table td small {
  display: block;
}

.production-history-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.production-history-table .remarks-cell {
  max-width: 260px;
  white-space: normal;
}

.actions-column {
  min-width: 220px;
}

.row-actions {
  min-width: 220px;
}

.table-action-button {
  margin: 2px 4px 2px 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.table-action-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.warning-text-button {
  color: #8a6100;
}

.danger-text-button {
  color: var(--danger);
}

.status-draft {
  background: #eef5ff;
  color: var(--blue);
}

.status-posted {
  background: #eaf8ef;
  color: #237a3b;
}

.status-cancelled {
  background: #f1f3f5;
  color: #626b75;
}

.entry-remarks {
  margin-top: 9px !important;
  color: var(--muted);
  font-size: 13px;
}

.split-actions {
  align-items: center;
}

.danger-outline-button,
.warning-outline-button {
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.danger-outline-button {
  border: 1px solid #c73b3b;
  color: #a72d2d;
}

.warning-outline-button {
  border: 1px solid #bd8a18;
  color: #8a6100;
}

.danger-button {
  background: #a72d2d;
}

.warning-button {
  background: #8a6100;
}

.reason-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .20);
}

.reason-dialog::backdrop {
  background: rgba(15, 23, 42, .48);
}

.reason-dialog form {
  padding: 22px;
}

.reason-dialog h2 {
  margin: 6px 0 8px;
}

.reason-dialog p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.mobile-entry-list {
  display: none;
}

.mobile-entry-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.mobile-entry-card + .mobile-entry-card {
  margin-top: 12px;
}

.mobile-entry-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mobile-entry-card-head strong,
.mobile-entry-card-head small {
  display: block;
}

.mobile-entry-card-head small {
  margin-top: 3px;
  color: var(--muted);
}

.mobile-entry-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 0;
}

.mobile-entry-card dl div {
  min-width: 0;
}

.mobile-entry-card dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mobile-entry-card dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.mobile-remarks {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.empty-table-cell {
  padding: 24px !important;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 820px) {
  .production-history-table {
    display: none;
  }

  .mobile-entry-list {
    display: block;
  }
}

@media (max-width: 700px) {
  .production-toolbar {
    align-items: stretch;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions button {
    flex: 1 1 180px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .search-field {
    max-width: none;
  }

  .split-actions {
    align-items: stretch;
  }

  .entry-action-buttons {
    width: 100%;
  }

  .entry-action-buttons button {
    flex: 1 1 120px;
  }

  .mobile-entry-card dl {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}


/* ============================================================
   Production Preview -> Confirm — v0.9
   ============================================================ */

.compact-production-form-card {
  max-width: 900px;
}

.simple-production-form {
  align-items: end;
}

.preview-not-saved-banner {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #b9d5f2;
  border-radius: 9px;
  background: #f4f9ff;
  color: #244665;
  line-height: 1.45;
}

.preview-not-saved-banner strong {
  color: #123e68;
}

.confirm-production-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 700px) {
  .confirm-production-actions {
    flex-direction: column-reverse;
  }

  .confirm-production-actions button {
    width: 100%;
  }
}


/* ============================================================
   Searchable Production Product Picker — v0.10
   ============================================================ */

.product-picker-field {
  position: relative;
}

.product-picker {
  position: relative;
}

.product-picker input[type="search"] {
  width: 100%;
}

.product-picker-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.product-suggestions {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .15);
}

.product-suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.product-suggestion:last-child {
  border-bottom: 0;
}

.product-suggestion:hover,
.product-suggestion.active {
  background: #f4f9ff;
}

.product-suggestion-main {
  min-width: 0;
}

.product-suggestion-main strong,
.product-suggestion-main span {
  display: block;
}

.product-suggestion-main strong {
  margin-bottom: 2px;
}

.product-suggestion-main span {
  color: var(--muted);
  font-size: 12px;
}

.product-suggestion-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.product-suggestion-status.bom-ready {
  background: #eaf8ef;
  color: #237a3b;
}

.product-suggestion-status.bom-missing {
  background: #fff4df;
  color: #8a6100;
}

.product-suggestion-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.bom-missing-text {
  color: #8a6100;
  font-weight: 700;
}

@media (max-width: 700px) {
  .product-suggestion {
    align-items: flex-start;
  }
}


/* ============================================================
   Admin modules — v0.11
   ============================================================ */

.three-filter-bar {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto;
  align-items: end;
}

.inline-check-filter,
.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-check-filter {
  min-height: 42px;
}

.inline-check-filter input,
.toggle-field input {
  width: auto;
}

.admin-table td strong,
.admin-table td small {
  display: block;
}

.admin-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.status-warning {
  background: #fff4df;
  color: #8a6100;
}

.success-text-button {
  color: #237a3b;
}

.table-action-link {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.admin-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.component-heading {
  align-items: end;
}

.component-editor-table {
  width: 100%;
  border-collapse: collapse;
}

.component-editor-table th,
.component-editor-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.component-editor-table input {
  min-width: 110px;
}

.component-editor-table td:first-child input {
  min-width: 260px;
}

.rights-user-card {
  display: grid;
  grid-template-columns: minmax(260px, 520px) 1fr;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.rights-selected-user {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.permission-group + .permission-group {
  margin-top: 24px;
}

.permission-group h3 {
  margin: 0 0 10px;
}

.permission-rows {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 120px 170px 100px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.permission-row:last-child {
  border-bottom: 0;
}

.permission-copy strong,
.permission-copy small {
  display: block;
}

.permission-copy small {
  margin-top: 3px;
  color: var(--muted);
}

.permission-default span,
.permission-mode span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.permission-effective {
  padding: 6px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.permission-effective.allowed {
  background: #eaf8ef;
  color: #237a3b;
}

.permission-effective.denied {
  background: #f1f3f5;
  color: #626b75;
}

.rights-save-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.dialog-static-content {
  padding: 22px;
}

.dialog-static-content h2 {
  margin: 6px 0 8px;
}

.dialog-static-content p {
  color: var(--muted);
  line-height: 1.5;
}

.bom-exempt-text {
  color: #237a3b;
  font-weight: 700;
}

@media (max-width: 900px) {
  .admin-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .permission-row {
    grid-template-columns: 1fr 120px 160px;
  }

  .permission-effective {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .three-filter-bar,
  .admin-form-grid,
  .rights-user-card {
    grid-template-columns: 1fr;
  }

  .permission-row {
    grid-template-columns: 1fr;
  }

  .component-editor-table td:first-child input {
    min-width: 200px;
  }
}


/* ============================================================
   Admin Operating System — v0.12
   Common Actions menu
   ============================================================ */

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.action-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu > summary::after {
  content: " ▾";
}

.action-menu[open] > summary {
  background: #f4f9ff;
}

.action-menu-popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 5px);
  right: 0;
  min-width: 170px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}

.action-menu-popover button,
.action-menu-popover a {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.action-menu-popover button:last-child,
.action-menu-popover a:last-child {
  border-bottom: 0;
}

.action-menu-popover button:hover,
.action-menu-popover a:hover {
  background: #f4f9ff;
}

.action-menu-popover .danger-text-button {
  color: #a52020;
}

.action-menu-popover .success-text-button {
  color: #237a3b;
}

.multi-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.receipt-line input,
.count-line input {
  min-width: 110px;
}

.receipt-line td:first-child input,
.count-line td:first-child input {
  min-width: 260px;
}

.status-draft {
  background: #fff4df;
  color: #8a6100;
}

@media (max-width: 700px) {
  .action-menu-popover {
    right: auto;
    left: 0;
  }

  .multi-actions {
    flex-direction: column;
  }

  .multi-actions button {
    width: 100%;
  }

  .receipt-line td:first-child input,
  .count-line td:first-child input {
    min-width: 200px;
  }
}

/* ============================================================
   Party Master — v0.14
   ============================================================ */
.party-filter-bar { grid-template-columns: minmax(220px, 320px) minmax(280px, 1fr); }
.party-table td strong, .party-table td small { display:block; }
.party-table td small { margin-top:3px; color:var(--muted); }
.party-section-card { margin-bottom:16px; }
.wide-two { grid-column: span 2; }
.party-two-column { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.party-check-group { margin:0; padding:14px; border:1px solid var(--border); border-radius:10px; }
.party-check-group legend { padding:0 6px; color:var(--navy); font-weight:800; }
.checkbox-stack { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; }
.party-check-option { display:flex; align-items:flex-start; gap:8px; padding:6px 0; }
.party-check-option input { width:auto; margin-top:2px; }
.party-check-option small { display:block; color:var(--muted); margin-top:2px; }
.party-channel-level { margin-top:16px; display:grid; grid-template-columns:minmax(240px,420px) 1fr; gap:14px; align-items:end; }
.party-channel-level[hidden] { display:none; }
.party-child-table input, .party-child-table select { min-width:120px; }
.party-child-table td:nth-child(1) input { min-width:180px; }
.party-details-block { margin:0 0 16px; border:1px solid var(--border); border-radius:12px; background:#fff; overflow:hidden; }
.party-details-block > summary { padding:14px 18px; cursor:pointer; font-weight:800; color:var(--navy); background:#f8fafc; }
.party-details-content { padding:16px; }
.party-child-cards { display:grid; gap:12px; }
.party-address-row { position:relative; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:14px; border:1px solid var(--border); border-radius:10px; background:#fbfcfd; }
.party-address-row .span-2 { grid-column:span 2; }
.party-address-row .span-4 { grid-column:1/-1; }
.party-address-actions { display:flex; justify-content:flex-end; align-items:end; }
.party-save-actions { margin:18px 0; justify-content:flex-end; }
.party-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.party-detail-card { padding:18px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.party-detail-card h3 { margin:0 0 10px; }
.party-detail-list { margin:0; padding-left:18px; }
.party-detail-list li + li { margin-top:7px; }
.party-tags { display:flex; flex-wrap:wrap; gap:6px; }
.party-tag { display:inline-block; padding:5px 8px; border-radius:999px; background:#eef5ff; color:var(--blue); font-size:11px; font-weight:800; }
.party-tag.channel { background:#eaf8ef; color:#237a3b; }
@media(max-width:900px){ .party-two-column,.party-detail-grid{grid-template-columns:1fr;} .party-channel-level{grid-template-columns:1fr;} .party-address-row{grid-template-columns:repeat(2,minmax(0,1fr));} .party-address-row .span-4{grid-column:1/-1;} }
@media(max-width:700px){ .party-filter-bar,.checkbox-stack,.party-address-row{grid-template-columns:1fr;} .wide-two,.party-address-row .span-2,.party-address-row .span-4{grid-column:auto;} }


/* 14. PARTY / DEALER ONBOARDING */
.field-help { margin: 6px 0 14px; color: #667085; font-size: 0.92rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-grid > div { padding: 12px; border: 1px solid #e4e7ec; border-radius: 8px; background: #fff; }
.left-actions { justify-content: flex-start; }
#dealerOnboarding > .form-card { margin-top: 16px; }
#channelLevelDisplay[readonly], #latitude[readonly], #longitude[readonly] { background: #f8fafc; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }

/* 15. SHARED CONTACT MASTER — v0.18 */
.contact-section-heading { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:12px; }
.contact-section-heading h3 { margin-bottom:4px; }
.contacts-editor { display:grid; gap:14px; }
.contact-editor-card { padding:16px; border:1px solid #dfe5ec; border-radius:10px; background:#fbfcfd; }
.contact-card-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:14px; }
.contact-card-heading small { display:block; margin-top:3px; color:var(--muted); }
.contact-card-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end; }
.contact-primary-choice { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--navy); }
.contact-primary-choice input { width:auto; margin:0; }
.contact-phone-block { margin-top:14px; padding-top:14px; border-top:1px solid #e4e7ec; }
.contact-phone-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; }
.contact-phone-list { display:grid; gap:8px; }
.contact-phone-row { display:grid; grid-template-columns:minmax(160px,1.1fr) minmax(200px,1.4fr) auto auto; gap:8px; align-items:center; }
.party-contact-view-list { display:grid; gap:10px; margin-top:8px; }
.party-contact-view-card { padding:10px; border:1px solid #e4e7ec; border-radius:8px; background:#f8fafc; }
.party-contact-view-card > small { display:block; margin:3px 0 6px; color:var(--muted); }
.wide-detail { grid-column:1/-1; }
@media (max-width:760px) {
  .contact-section-heading,.contact-card-heading { flex-direction:column; }
  .contact-card-actions { justify-content:flex-start; }
  .contact-phone-row { grid-template-columns:1fr; }
}
