/* RFQ Team overlay – supplements shared workbench CSS. No nesting, plain CSS only. */

#app {
  padding: 0;
}

#app > .notice,
#app > .kpis,
#app > .filters,
#app > .table-wrap {
  margin: 16px 24px;
}

header.top {
  position: sticky;
  top: 0;
  height: auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 1;
  background: #102f40;
}

header.top h1 {
  font-size: 18px;
  margin: 0;
}

header.top .notice {
  color: #172b36;
}

/* KPI cards – prevent inline-block concatenation of label/scope/time */
.kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.kpi {
  display: flex;
  flex-direction: column;
}

.kpi span,
.kpi small,
.kpi time {
  display: block;
}

.kpi time {
  font-size: 11px;
  color: #6b7280;
}

/* Drawer overrides – tame the huge all-green bold line and native div issues */
.drawer > .native,
.drawer .line > .native,
.drawer .product-results,
.drawer .customer-results {
  display: block;
  width: auto;
  margin: 8px 0;
}

.drawer .native {
  color: inherit;
  font-weight: 400;
}

.drawer h3 {
  color: #1f2937;
}

.drawer a {
  display: block;
  margin: 12px 0;
  color: #087f80;
}

.drawer .line p {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Form inputs */
input {
  font-size: 14px;
  border: 1px solid #d1d5db;
  padding: 6px 8px;
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
}

textarea.copy-fallback {
  width: 100%;
  min-height: 100px;
  box-sizing: border-box;
}

/* Mobile <= 600px */
@media (max-width: 600px) {
  header.top {
    flex-direction: column;
    align-items: flex-start;
  }

  .head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  #app > .notice,
  #app > .kpis,
  #app > .filters,
  #app > .table-wrap {
    margin: 12px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .drawer {
    width: 100%;
  }

  button {
    min-height: 40px;
    min-width: 40px;
  }

  input {
    max-width: 100%;
  }
}

/* Permissions management */
.permission-host { padding: 20px 24px; }
.perm-head, .perm-filters, .perm-actions, .perm-dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.perm-head { justify-content: space-between; }
.perm-filters { margin: 16px 0; }
.perm-filters input { flex: 1; min-width: 180px; }
.perm-panel select, .perm-dialog select { padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; background: white; }
.perm-table-wrap { overflow-x: auto; }
.perm-table-wrap table { width: 100%; min-width: 850px; }
.perm-dialog-overlay { position: fixed; inset: 0; z-index: 20; background: #102f4077; display: flex; align-items: center; justify-content: center; padding: 16px; }
.perm-dialog { background: white; color: #172b36; border-radius: 10px; padding: 24px; width: min(520px, 100%); max-height: 85vh; overflow: auto; }
.perm-selection-summary { margin: 12px 0; overflow-wrap: anywhere; }
.perm-dialog-actions { margin-top: 20px; justify-content: flex-end; }
@media (max-width: 600px) { .permission-host { padding: 12px; } }
.perm-confirm-overlay { z-index: 30; }
.perm-confirm-dialog { max-width: 400px; }
.perm-row-error { color: #b91c1c; font-size: 0.875rem; padding: 4px 8px; }

/* Sales assignment management */
.assignment-host { padding: 20px 24px; }
.assignment-panel { max-width: 1280px; }
.assignment-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.assignment-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; border-bottom: 1px solid #d1d5db; }
.assignment-tab { border: 1px solid transparent; border-bottom: none; background: transparent; color: #1f2d2d; }
.assignment-tab.active { border-color: #d1d5db; background: white; color: #087f80; font-weight: 600; }
.assignment-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.assignment-primary { background: #087f80; color: #fff; border-color: #087f80; }
.assignment-danger { color: #b91c1c; border-color: #b91c1c; }
.assignment-section { margin: 20px 0; }
.assignment-unmapped { margin-top: 12px; }
.assignment-inline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #e5e7eb; }
.assignment-table-wrap { overflow-x: auto; margin: 0; }
.assignment-table-wrap table { width: 100%; min-width: 1000px; }
.assignment-form { display: grid; gap: 12px; }
.assignment-field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.assignment-dialog-overlay { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: #102f4077; padding: 16px; }
.assignment-dialog { width: min(520px, 100%); max-height: 85vh; overflow: auto; background: white; color: #172b36; border-radius: 10px; padding: 22px; }
.assignment-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.assignment-definition { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 8px 0; }
.assignment-definition dt { color: #6b7280; }
.assignment-definition dd { margin: 0; overflow-wrap: anywhere; }
.assignment-simulate-form { display: grid; gap: 12px; max-width: 560px; margin-bottom: 18px; }
.assignment-simulate-result { border-top: 1px solid #d1d5db; padding-top: 14px; }
.assignment-warnings { color: #92400e; }
.assignment-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.assignment-preview, .assignment-manual-form { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f9fafb; }
.assignment-manual-form input, .assignment-manual-form select { max-width: 420px; }
.assignment-action-error { color: #b91c1c; }
.assignment-table-wrap td { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .assignment-host { padding: 12px; }
  .assignment-definition { grid-template-columns: 1fr; }
  .assignment-dialog { padding: 16px; }
}
