/* ============================================================
   ProspectOS Zone Reports
   Phase 1 report generator styles. All classes use zr- prefix.
   ============================================================ */

.zr-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 88px);
  min-height: 520px;
}

.zr-control-panel,
.zr-preview-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.zr-control-panel {
  display: flex;
  flex-direction: column;
}

.zr-panel-header {
  background: var(--charcoal, #2B2B2B);
  color: white;
  padding: 12px 14px;
  border-left: 4px solid var(--pcc-red, #ED1C24);
}

.zr-panel-title {
  font-size: 13px;
  font-weight: 800;
}

.zr-panel-subtitle {
  color: #bfdbfe;
  font-size: 10px;
  margin-top: 2px;
}

.zr-form {
  padding: 14px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.zr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding-top: 6px;
}

.zr-actions .btn-primary {
  grid-column: 1 / -1;
  justify-content: center;
}

.zr-actions .btn-dark {
  grid-column: 1 / -1;
  justify-content: center;
  background: var(--charcoal, #2B2B2B);
  color: white;
  border-color: var(--charcoal, #2B2B2B);
}

.zr-actions .btn-secondary {
  justify-content: center;
}

.zr-preview-toolbar .btn-primary {
  background: var(--pcc-red, #ED1C24);
  border-color: var(--pcc-red, #ED1C24);
  color: white;
  white-space: nowrap;
}

.zr-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.zr-preview-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.zr-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.zr-preview-meta {
  font-size: 10px;
  color: var(--muted);
}

#zr-report-preview {
  flex: 1;
  overflow: auto;
  padding: 18px;
  background: #e5e7eb;
}

.zr-empty-state {
  margin: 30px auto;
  max-width: 520px;
  background: white;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--slate);
}

.zr-empty-title {
  color: var(--navy);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 6px;
}

.zr-report-page {
  max-width: 980px;
  min-height: 1180px;
  margin: 0 auto;
  background: white;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-lg);
  padding: 38px 44px;
}

.zr-report-cover {
  border-bottom: 3px solid var(--pcc-red, #ED1C24);
  padding-bottom: 18px;
  margin-bottom: 22px;
}

/* ── PCC Identity block in cover ── */
.zr-cover-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.zr-cover-logo-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.zr-cover-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  display: block;
}

.zr-cover-wordmark {
  font-family: 'Aptos', Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #2B2B2B;
  line-height: 1;
}

.zr-cover-app-name {
  font-family: 'Aptos', Helvetica, Arial, sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pcc-red, #ED1C24);
  margin-top: 4px;
}

.zr-cover-confidential-pill {
  background: var(--pcc-red, #ED1C24);
  color: white;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 3px;
  align-self: flex-start;
}

.zr-cover-rule {
  width: 44px;
  height: 4px;
  background: var(--pcc-red, #ED1C24);
  border-radius: 2px;
  margin-bottom: 12px;
}

/* Legacy .zr-confidential kept for compatibility */
.zr-confidential {
  color: var(--pcc-red, #ED1C24);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.zr-report-title {
  color: #2B2B2B;
  font-size: 26px;
  line-height: 1.18;
  font-weight: 800;
  margin-bottom: 8px;
}

.zr-report-territory {
  color: #555555;
  font-size: 14px;
  font-weight: 600;
}

.zr-report-rep {
  color: #2B2B2B;
  font-size: 12px;
  font-weight: 700;
  margin-top: 5px;
}

.zr-report-rep span {
  color: #8A8A8A;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-right: 8px;
}

.zr-report-date {
  color: #8A8A8A;
  font-size: 11px;
  margin-top: 8px;
}

/* ── Geographic context block ── */
.zr-geo-block {
  background: #F3F4F6;
  border: 1px solid #D9D9D9;
  border-left: 4px solid var(--pcc-red, #ED1C24);
  border-radius: 4px;
  padding: 14px 16px;
  margin-top: 14px;
}

.zr-geo-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #2B2B2B;
  margin-bottom: 10px;
}

.zr-geo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.zr-geo-cell {
  background: white;
  border: 1px solid #D9D9D9;
  border-radius: 4px;
  padding: 8px 10px;
}

.zr-geo-cell-wide {
  grid-column: 1 / -1;
}

.zr-geo-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8A8A8A;
  margin-bottom: 3px;
}

.zr-geo-val {
  font-size: 11px;
  font-weight: 600;
  color: #2B2B2B;
  line-height: 1.4;
}

/* ── Footer logo ── */
.zr-footer-logo {
  height: 20px;
  width: auto;
  object-fit: contain;
  opacity: .55;
}

.zr-report-section {
  margin: 22px 0;
}

.zr-report-section h2 {
  color: #2B2B2B;
  border-bottom: 2px solid var(--pcc-red, #ED1C24);
  font-size: 13px;
  font-weight: 800;
  padding-bottom: 6px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.zr-report-section p,
.zr-report-section li {
  font-size: 12px;
  line-height: 1.55;
}

.zr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.zr-kpi-card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}

.zr-kpi-value {
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
}

.zr-kpi-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  margin-top: 2px;
  text-transform: uppercase;
}

.zr-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  margin-top: 10px;
}

.zr-data-table th {
  background: var(--navy);
  color: white;
  padding: 7px 8px;
  text-align: left;
  font-size: 9.5px;
}

.zr-data-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.zr-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.zr-badge-a { background: #fee2e2; color: #b91c1c; }
.zr-badge-b { background: #fef3c7; color: #92400e; }
.zr-badge-c { background: #dbeafe; color: #1e40af; }
.zr-badge-d { background: #f1f5f9; color: #475569; }
.zr-badge-ets { background: #fff7ed; color: #c2410c; }

.zr-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.zr-plan-list,
.zr-risk-list {
  display: grid;
  gap: 8px;
}

.zr-plan-block,
.zr-risk-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}

.zr-plan-block h3,
.zr-risk-item h3 {
  color: var(--navy);
  font-size: 12px;
  margin-bottom: 6px;
}

.zr-report-page ul {
  list-style-position: outside;
  margin: 0;
  padding-left: 18px;
}

.zr-report-page li {
  padding-left: 2px;
  margin: 0 0 5px;
}

.zr-plan-block ul,
.zr-action-list {
  box-sizing: border-box;
  color: #2B2B2B;
  font-size: 11px;
  line-height: 1.6;
  margin: 0;
  padding-left: 18px;
}

.zr-plan-block li,
.zr-action-list li {
  overflow-wrap: anywhere;
  padding-left: 3px;
}

.zr-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  margin-top: 26px;
  padding-top: 10px;
}

.zr-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.zr-map-figure {
  margin: 12px 0 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.zr-territory-map {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 1050px) {
  .zr-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .zr-preview-panel {
    min-height: 720px;
  }

  .zr-kpi-grid,
  .zr-two-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  body {
    overflow: visible;
    background: white;
  }

  .sidebar,
  .topbar,
  .zr-control-panel,
  .zr-preview-toolbar {
    display: none !important;
  }

  .main-area,
  .module-content,
  #zr-report-preview {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    background: white !important;
  }

  .zr-layout {
    display: block;
    height: auto;
  }

  .zr-preview-panel,
  .zr-report-page {
    border: 0;
    box-shadow: none;
  }
}
