/* TradeRail — PR301 Address Hub styles
   Fleet-style fixed panel: top:var(--nav-h) left:16.5rem
   Matches PR300 Projects layout exactly.
   =========================================================== */

/* ─── Root panel ─── */
#pr301-root {
  position: fixed;
  top: var(--nav-h, 48px);
  left: 16.5rem;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--surface, #f5f5f5);
  display: none;
  flex-direction: column;
  z-index: 10;
}
#pr301-root.pr301-active {
  display: flex;
}

/* Respond to sidebar collapse — shift left edge to match icon-rail width */
@media (min-width: 768px) {
  body.pui1b-mounted.pui1b-collapsed #pr301-root {
    left: 3.5rem;
    transition: left 300ms ease;
  }
  body.pui1b-mounted:not(.pui1b-collapsed) #pr301-root {
    left: 16.5rem;
    transition: left 300ms ease;
  }
}
/* Mobile: offset by icon-rail width (3.5rem = 56px) */
@media (max-width: 767px) {
  body[data-tr-role]:not([data-tr-role="field_tech"]).pui1b-mounted #pr301-root {
    left: 3.5rem !important;
  }
  body[data-tr-role="field_tech"].pui1b-mounted #pr301-root {
    left: 0 !important;
  }
}

/* Hide other panels when Address Hub is active */
body[data-pr301-active="1"] #vHome,
body[data-pr301-active="1"] #vPlanHub,
body[data-pr301-active="1"] #vService,
body[data-pr301-active="1"] #vScheduler,
body[data-pr301-active="1"] #vProjects,
body[data-pr301-active="1"] #vCategory,
body[data-pr301-active="1"] #pr300-root,
body[data-pr301-active="1"] #vFleetManagement {
  display: none !important;
}

/* ─── Landing page ─── */
.pr301-landing {
  padding: 24px 32px 80px;
  max-width: 1200px;
}

.pr301-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.pr301-search-input {
  flex: 1;
  height: 40px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.pr301-search-input:focus {
  border-color: #FF6B00;
}
.pr301-add-btn {
  height: 40px;
  padding: 0 18px;
  background: #FF6B00;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.pr301-add-btn:hover {
  background: #e55f00;
}

/* ─── Filter chips ─── */
.pr301-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.pr301-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #d0d0d0;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}
.pr301-chip.active,
.pr301-chip:hover {
  border-color: #FF6B00;
  color: #FF6B00;
  background: #fff8f3;
}

/* ─── Stats row ─── */
.pr301-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.pr301-stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid #e8e8e8;
}
.pr301-stat-val {
  font-size: 26px;
  font-weight: 700;
  color: #1A1A2E;
  line-height: 1.1;
}
.pr301-stat-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ─── Pending approval banner ─── */
.pr301-pending-banner {
  background: #fff8f3;
  border: 1.5px solid #FF6B00;
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pr301-pending-banner-text {
  font-size: 13px;
  font-weight: 600;
  color: #FF6B00;
}
.pr301-pending-banner-sub {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}
.pr301-pending-review-btn {
  padding: 7px 16px;
  background: #FF6B00;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ─── Section header ─── */
.pr301-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pr301-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1A1A2E;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Address grid ─── */
.pr301-address-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 1100px) {
  .pr301-address-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Address card ─── */
.pr301-addr-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.pr301-addr-card:hover {
  border-color: #FF6B00;
  box-shadow: 0 2px 12px rgba(255,107,0,0.08);
}
.pr301-addr-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pr301-addr-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.pr301-addr-type-badge.residential { background: #e8f5e9; color: #2e7d32; }
.pr301-addr-type-badge.commercial  { background: #e3f2fd; color: #1565c0; }
.pr301-addr-type-badge.public-works { background: #f3e5f5; color: #7b1fa2; }
.pr301-addr-type-badge.mixed-use   { background: #fff8e1; color: #f57f17; }
.pr301-addr-type-badge.subdivision { background: #fbe9e7; color: #bf360c; }

.pr301-addr-street {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 2px;
  line-height: 1.3;
}
.pr301-addr-city {
  font-size: 12px;
  color: #666;
  margin: 0 0 10px;
}
.pr301-addr-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: #888;
}
.pr301-addr-meta-item strong {
  color: #1A1A2E;
  font-weight: 700;
}
.pr301-addr-activity {
  font-size: 11px;
  color: #aaa;
  margin-top: 8px;
}
.pr301-addr-tr-id {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10px;
  color: #bbb;
  font-weight: 600;
}

/* ─── Subdivision badge on address card ─── */
.pr301-subdivision-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #bf360c;
  background: #fbe9e7;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
  font-weight: 600;
}

/* ─── Hub page layout ─── */
.pr301-hub {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ─── Breadcrumb ─── */
.pr301-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #888;
  padding: 14px 32px 0;
  flex-shrink: 0;
}
.pr301-breadcrumb a,
.pr301-breadcrumb-link {
  color: #FF6B00;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  background: none;
  border: none;
  font-size: 12px;
  padding: 0;
}
.pr301-breadcrumb a:hover,
.pr301-breadcrumb-link:hover { text-decoration: underline; }
.pr301-breadcrumb-sep { color: #ccc; }
.pr301-breadcrumb-current { color: #1A1A2E; font-weight: 600; }

/* ─── Hub header card ─── */
.pr301-hub-header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 16px 32px 0;
  flex-shrink: 0;
}
.pr301-hub-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}
.pr301-hub-address-block {
  flex: 1;
}
.pr301-hub-street {
  font-size: 20px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 2px;
}
.pr301-hub-city {
  font-size: 13px;
  color: #666;
  margin: 0 0 6px;
}
.pr301-hub-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pr301-hub-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pr301-hub-action-btn {
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #d0d0d0;
  background: #fff;
  color: #1A1A2E;
  transition: all 0.15s;
}
.pr301-hub-action-btn:hover {
  border-color: #FF6B00;
  color: #FF6B00;
}
.pr301-hub-action-btn.primary {
  background: #FF6B00;
  color: #fff;
  border-color: #FF6B00;
}
.pr301-hub-action-btn.primary:hover { background: #e55f00; }

/* ─── Scorecard ─── */
.pr301-scorecard {
  display: flex;
  gap: 32px;
  padding: 12px 0;
  border-top: 1px solid #f0f0f0;
}
.pr301-scorecard-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.12s;
}
.pr301-scorecard-item:hover { background: #f8f8f8; }
.pr301-scorecard-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  font-weight: 600;
}
.pr301-scorecard-val {
  font-size: 15px;
  font-weight: 700;
  color: #1A1A2E;
}
.pr301-scorecard-val.orange { color: #FF6B00; }
.pr301-scorecard-val.green  { color: #2e7d32; }
.pr301-scorecard-val.red    { color: #c62828; }

/* ─── Lily summary ─── */
.pr301-lily-summary {
  font-size: 12px;
  color: #FF6B00;
  padding: 8px 0 12px;
  border-top: 1px solid #f0f0f0;
  line-height: 1.5;
}
.pr301-lily-summary-label {
  font-weight: 700;
  margin-right: 4px;
}

/* ─── Forward email ─── */
.pr301-forward-email-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #888;
  padding-bottom: 12px;
}
.pr301-forward-email-val {
  font-family: monospace;
  color: #1A1A2E;
  font-weight: 600;
  font-size: 11px;
}
.pr301-copy-btn {
  padding: 3px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f8f8f8;
  font-size: 11px;
  cursor: pointer;
  color: #555;
}
.pr301-copy-btn:hover { border-color: #FF6B00; color: #FF6B00; }

/* ─── Hub body: filter + timeline ─── */
.pr301-hub-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 32px 80px;
  overflow-y: auto;
  min-height: 0;
}

/* ─── Search + filter bar ─── */
.pr301-timeline-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 12px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pr301-timeline-search {
  flex: 1;
  min-width: 200px;
  height: 36px;
  border: 1px solid #d8d8d8;
  border-radius: 7px;
  padding: 0 12px;
  font-size: 13px;
  background: #fff;
  outline: none;
}
.pr301-timeline-search:focus { border-color: #FF6B00; }
.pr301-filter-chip-sm {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1.5px solid #d0d0d0;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.pr301-filter-chip-sm.active,
.pr301-filter-chip-sm:hover {
  border-color: #FF6B00;
  color: #FF6B00;
  background: #fff8f3;
}

/* ─── Timeline ─── */
.pr301-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Upcoming header */
.pr301-timeline-upcoming-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FF6B00;
  margin-bottom: 10px;
}
.pr301-timeline-upcoming-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #ffe0c4;
}

/* Past header */
.pr301-timeline-past-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
  margin: 16px 0 10px;
}
.pr301-timeline-past-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #eeeeee;
}

/* Timeline entry card */
.pr301-tl-entry {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 4px;
}
.pr301-tl-entry:hover { background: #fafafa; }
.pr301-tl-entry:last-child { border-bottom: none; }

.pr301-tl-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.pr301-tl-icon.project   { background: #e3f2fd; }
.pr301-tl-icon.financial { background: #e8f5e9; }
.pr301-tl-icon.compliance{ background: #f3e5f5; }
.pr301-tl-icon.field     { background: #fff8e1; }
.pr301-tl-icon.service   { background: #fce4ec; }
.pr301-tl-icon.email     { background: #e0f7fa; }
.pr301-tl-icon.contract  { background: #f1f8e9; }

.pr301-tl-content {
  flex: 1;
  min-width: 0;
}
.pr301-tl-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.pr301-tl-event-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  white-space: nowrap;
}
.pr301-tl-date {
  font-size: 11px;
  color: #bbb;
  white-space: nowrap;
  flex-shrink: 0;
}
.pr301-tl-desc {
  font-size: 13px;
  color: #1A1A2E;
  margin: 3px 0 2px;
  line-height: 1.4;
}
.pr301-tl-meta {
  font-size: 11px;
  color: #aaa;
}
.pr301-tl-arrow {
  font-size: 16px;
  color: #ccc;
  flex-shrink: 0;
  align-self: center;
}
.pr301-tl-entry:hover .pr301-tl-arrow { color: #FF6B00; }

/* Failure flag */
.pr301-tl-failure {
  display: inline-block;
  background: #c62828;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ─── Parent address / subdivision block ─── */
.pr301-parent-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}
.pr301-parent-link-val {
  color: #FF6B00;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.pr301-parent-link-val:hover { text-decoration: underline; }

/* ─── Lot list (parent hub) ─── */
.pr301-lot-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 10px;
}
.pr301-lot-list-title {
  font-size: 13px;
  font-weight: 700;
  color: #1A1A2E;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pr301-lot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pr301-lot-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #e8e8e8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}
.pr301-lot-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.pr301-lot-table tr:hover td { background: #fafafa; }
.pr301-lot-table tr { cursor: pointer; }
.pr301-lot-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.pr301-lot-status-dot.active   { background: #43a047; }
.pr301-lot-status-dot.complete { background: #1565c0; }
.pr301-lot-status-dot.not-started { background: #e0e0e0; }

/* ─── Approval card ─── */
.pr301-approval-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 32px 80px;
  max-width: 860px;
}
.pr301-approval-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #e8e8e8;
  padding: 20px 24px;
  transition: border-color 0.15s;
}
.pr301-approval-card:hover { border-color: #FF6B00; }

.pr301-approval-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.pr301-approval-address {
  font-size: 16px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 2px;
}
.pr301-approval-source {
  font-size: 12px;
  color: #888;
  margin: 0;
}
.pr301-confidence {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.pr301-confidence-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  font-weight: 600;
}
.pr301-confidence-val {
  font-size: 14px;
  font-weight: 700;
}
.pr301-confidence-val.high   { color: #2e7d32; }
.pr301-confidence-val.medium { color: #f57c00; }
.pr301-confidence-val.low    { color: #c62828; }

.pr301-approval-context {
  background: #f8f8f8;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 12px;
  color: #555;
  margin-bottom: 14px;
  line-height: 1.5;
}
.pr301-approval-context-label {
  font-weight: 700;
  color: #888;
  margin-right: 4px;
}

/* Duplicate warning */
.pr301-dup-warning {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 12px;
  color: #e65100;
  margin-bottom: 14px;
}

.pr301-approval-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pr301-approval-btn {
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
}
.pr301-approval-btn.confirm {
  background: #FF6B00;
  color: #fff;
}
.pr301-approval-btn.confirm:hover { background: #e55f00; }
.pr301-approval-btn.edit {
  background: #fff;
  border-color: #1A1A2E;
  color: #1A1A2E;
}
.pr301-approval-btn.edit:hover { border-color: #FF6B00; color: #FF6B00; }
.pr301-approval-btn.merge {
  background: #fff;
  border-color: #888;
  color: #555;
}
.pr301-approval-btn.merge:hover { border-color: #FF6B00; color: #FF6B00; }
.pr301-approval-btn.dismiss {
  background: #fff;
  border-color: #e0e0e0;
  color: #aaa;
}
.pr301-approval-btn.dismiss:hover { border-color: #c62828; color: #c62828; }

/* ─── Empty state ─── */
.pr301-empty {
  text-align: center;
  padding: 60px 40px;
  color: #aaa;
}
.pr301-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 6px;
}
.pr301-empty-sub {
  font-size: 13px;
  color: #aaa;
  line-height: 1.5;
}

/* ─── Toast ─── */
.pr301-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1A1A2E;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.pr301-toast.show {
  opacity: 1;
  transform: translateY(0);
}
