/* =============================================================
   TradeRail — PR233: Compliance Module styles
   Namespace : tr233-*
   Brand     : #FF6B00 primary, #1A1A2E dark
   ============================================================= */

/* ── wrap ─────────────────────────────────────────────────────── */
.tr233-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── header ───────────────────────────────────────────────────── */
.tr233-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.tr233-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0;
}
.tr233-header-actions {
  display: flex;
  align-items: center;
  gap: .625rem;
}

/* ── tabs ─────────────────────────────────────────────────────── */
.tr233-tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid #e5e5e5;
  margin-bottom: 1.5rem;
}
.tr233-tab {
  padding: .625rem 1.25rem;
  border: none;
  background: none;
  font-size: .9375rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tr233-tab:hover { color: #FF6B00; }
.tr233-tab.active {
  color: #FF6B00;
  border-bottom-color: #FF6B00;
  font-weight: 600;
}

/* ── section ──────────────────────────────────────────────────── */
.tr233-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── card ─────────────────────────────────────────────────────── */
.tr233-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 1.25rem 1.375rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tr233-card-alert {
  border-left: 4px solid #FF6B00;
}
.tr233-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .875rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.tr233-card-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0;
}
.tr233-card-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.tr233-card-meta {
  font-size: .8125rem;
  color: #666;
  margin: 0 0 .875rem;
  line-height: 1.5;
}

/* ── schedule banner ──────────────────────────────────────────── */
.tr233-schedule-banner {
  display: flex;
  align-items: center;
  gap: .625rem;
  background: #fff8f0;
  border: 1px solid #ffd4a8;
  border-radius: 7px;
  padding: .625rem .875rem;
  font-size: .8125rem;
  color: #1A1A2E;
  margin-bottom: .875rem;
  flex-wrap: wrap;
}
.tr233-schedule-icon {
  color: #FF6B00;
  font-size: .75rem;
}

/* ── table ────────────────────────────────────────────────────── */
.tr233-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.tr233-table th {
  text-align: left;
  padding: .5rem .625rem;
  font-size: .75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #e5e5e5;
  white-space: nowrap;
}
.tr233-table td {
  padding: .625rem .625rem;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  vertical-align: middle;
}
.tr233-table tr:last-child td { border-bottom: none; }
.tr233-table tr:hover td { background: #fafafa; }
.tr233-empty {
  text-align: center;
  color: #aaa;
  font-style: italic;
  padding: 1.5rem !important;
}
.tr233-actions {
  white-space: nowrap;
  display: flex;
  gap: .375rem;
  align-items: center;
}

/* ── badges ───────────────────────────────────────────────────── */
.tr233-badge {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.tr233-status-ok       { background: #e6f4ea; color: #1a6630; }
.tr233-status-warning  { background: #fff3e0; color: #b45309; }
.tr233-status-critical { background: #fde8e8; color: #b91c1c; }
.tr233-status-expired  { background: #fde8e8; color: #b91c1c; }
.tr233-status-unknown  { background: #f0f0f0; color: #666; }

.tr233-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FF6B00;
  color: #fff;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 700;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 .375rem;
  margin-left: .375rem;
}

/* ── lily badges ──────────────────────────────────────────────── */
.tr233-lily-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: #1A1A2E;
  color: #FF6B00;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .5rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.tr233-lily-tag {
  display: inline-block;
  background: #FF6B00;
  color: #fff;
  border-radius: 3px;
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .35rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-left: .25rem;
}

/* ── job type tag ─────────────────────────────────────────────── */
.tr233-job-type-tag {
  display: inline-block;
  background: #e8f0fe;
  color: #1a56db;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .5rem;
  margin-left: .5rem;
}

/* ── progress ─────────────────────────────────────────────────── */
.tr233-progress {
  font-size: .8125rem;
  color: #555;
}

/* ── public works checklist ───────────────────────────────────── */
.tr233-pw-card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1rem 1.125rem;
  margin-bottom: .75rem;
  background: #fafafa;
}
.tr233-pw-card:last-child { margin-bottom: 0; }
.tr233-pw-card-header {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: .875rem;
  flex-wrap: wrap;
}
.tr233-pw-card-header strong {
  font-size: .9375rem;
  color: #1A1A2E;
}
.tr233-steps {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}
.tr233-step {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  font-size: .875rem;
}
.tr233-step-green  { background: #e6f4ea; }
.tr233-step-yellow { background: #fff8e1; }
.tr233-step-red    { background: #fde8e8; }
.tr233-step-icon {
  font-size: .875rem;
  font-weight: 700;
  min-width: 1.125rem;
  text-align: center;
}
.tr233-step-green  .tr233-step-icon { color: #1a6630; }
.tr233-step-yellow .tr233-step-icon { color: #b45309; }
.tr233-step-red    .tr233-step-icon { color: #b91c1c; }
.tr233-step-label {
  font-weight: 600;
  color: #1A1A2E;
  min-width: 11rem;
}
.tr233-step-note {
  color: #555;
  font-size: .8125rem;
}

/* ── lily assist box ──────────────────────────────────────────── */
.tr233-lily-assist-box {
  background: #fff8f0;
  border: 1px solid #ffd4a8;
  border-radius: 7px;
  padding: .75rem 1rem;
  margin-top: .75rem;
}
.tr233-lily-assist-box p {
  margin: .375rem 0 0;
  font-size: .8125rem;
  color: #555;
}

/* ── digest ───────────────────────────────────────────────────── */
.tr233-digest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.tr233-digest-row:last-child { border-bottom: none; }
.tr233-digest-label {
  font-size: .9375rem;
  color: #333;
  font-weight: 500;
}

/* ── buttons ──────────────────────────────────────────────────── */
.tr233-btn-primary {
  background: #FF6B00;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.tr233-btn-primary:hover { background: #cc5500; }

.tr233-btn-secondary {
  background: #fff;
  color: #1A1A2E;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.tr233-btn-secondary:hover { border-color: #FF6B00; color: #FF6B00; }

.tr233-btn-xs {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: .25rem .625rem;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.tr233-btn-xs:hover { background: #ffe8d4; border-color: #FF6B00; color: #FF6B00; }

/* ── modal ────────────────────────────────────────────────────── */
.tr233-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tr233-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
}
.tr233-modal-wide { max-width: 680px; }
.tr233-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.25rem .875rem;
  border-bottom: 1px solid #e5e5e5;
}
.tr233-modal-header h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1A1A2E;
}
.tr233-modal-close {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  color: #999;
  padding: .25rem;
  line-height: 1;
  transition: color .15s;
}
.tr233-modal-close:hover { color: #FF6B00; }
.tr233-modal-body {
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .875rem;
  flex: 1;
}
.tr233-modal-footer {
  padding: .875rem 1.25rem 1.125rem;
  border-top: 1px solid #e5e5e5;
  display: flex;
  justify-content: flex-end;
  gap: .625rem;
}

/* ── form inputs ──────────────────────────────────────────────── */
.tr233-label {
  display: flex;
  flex-direction: column;
  gap: .3125rem;
  font-size: .875rem;
  font-weight: 600;
  color: #333;
}
.tr233-req { color: #FF6B00; }
.tr233-input {
  padding: .5rem .75rem;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: .9rem;
  color: #1A1A2E;
  background: #fff;
  transition: border-color .15s;
  font-family: inherit;
}
.tr233-input:focus {
  outline: none;
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,.1);
}
.tr233-textarea { resize: vertical; min-height: 5rem; }

/* ── toast notifications ──────────────────────────────────────── */
.tr233-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  padding: .75rem 1.125rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  max-width: 360px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: tr233FadeIn .2s ease;
  color: #fff;
}
.tr233-toast-success { background: #1a6630; }
.tr233-toast-error   { background: #b91c1c; }
.tr233-toast-info    { background: #1A1A2E; }
.tr233-toast-warning { background: #b45309; }

@keyframes tr233FadeIn {
  from { opacity: 0; transform: translateY(.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── mobile ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .tr233-wrap { padding: 1rem; }
  .tr233-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tr233-steps { gap: .25rem; }
  .tr233-step { flex-wrap: wrap; }
  .tr233-step-label { min-width: auto; }
  .tr233-modal { max-width: 100%; margin: 0; border-radius: 12px 12px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-height: 85vh; }
  .tr233-modal-overlay { align-items: flex-end; padding: 0; }
}

/* ── Toolbox Talk Library Picker ─────────────────────────────── */
.tr233-modal--wide { max-width: 680px; width: 96vw; }

.tr233-talk-mode-row { display:flex; gap:6px; margin-bottom:14px; border-bottom:2px solid #f0f0f0; padding-bottom:10px; }
.tr233-talk-mode-row .tr233-tab { flex:1; padding:7px 10px; font-size:13px; border:1px solid #e0e0e0; border-radius:6px; background:#f7f7f7; cursor:pointer; color:#555; transition:all .15s; }
.tr233-talk-mode-row .tr233-tab--active { background:#FF6B00; color:#fff; border-color:#FF6B00; font-weight:600; }

/* Lily auto-pick card */
.tr233-lily-autopick-card { background:#fff8f0; border:1.5px solid #FF6B00; border-radius:10px; padding:14px 16px; margin-bottom:2px; }
.tr233-lily-autopick-header { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.tr233-lily-autopick-reason { font-size:11.5px; color:#FF6B00; font-weight:600; background:#fff3e8; border-radius:4px; padding:2px 7px; }
.tr233-lily-autopick-title { font-size:15px; font-weight:700; color:#1A1A2E; margin-bottom:4px; }
.tr233-lily-autopick-meta { font-size:12px; color:#888; margin-bottom:6px; text-transform:capitalize; }
.tr233-lily-autopick-points { font-size:12px; color:#555; line-height:1.6; }

/* Library list */
.tr233-library-search { margin-bottom:8px; }
.tr233-library-list { max-height:260px; overflow-y:auto; border:1px solid #e8e8e8; border-radius:8px; }
.tr233-library-row { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid #f2f2f2; gap:10px; cursor:pointer; transition:background .12s; }
.tr233-library-row:last-child { border-bottom:none; }
.tr233-library-row:hover { background:#fafafa; }
.tr233-library-row--selected { background:#fff8f0 !important; border-left:3px solid #FF6B00; }
.tr233-library-row-left { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.tr233-library-title { font-size:13px; font-weight:600; color:#1A1A2E; }
.tr233-library-reason { font-size:11px; color:#FF6B00; font-weight:600; }
.tr233-library-meta { font-size:11px; color:#999; text-transform:capitalize; }
.tr233-library-row-right { flex-shrink:0; }
.tr233-library-check { font-size:12px; color:#27ae60; font-weight:700; }
.tr233-library-empty { padding:20px; text-align:center; color:#aaa; font-size:13px; }

/* Lily tag small variant */
.tr233-lily-tag--sm { font-size:10px; padding:2px 6px; }

/* Schedule modal additions */
.tr233-field-hint { display:block; font-size:11.5px; color:#888; margin-top:3px; }
.tr233-label--inline { flex-direction:row; align-items:center; gap:6px; }

/* Shared scheduling fields */
.tr233-talk-sched-fields { margin-top:14px; padding-top:14px; border-top:1px solid #f0f0f0; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media (max-width: 480px) { .tr233-talk-sched-fields { grid-template-columns:1fr; } }
