/* Scorecard Presentation - Single Page Layout (matching BSC Template) */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.4;
}

.hidden {
  display: none !important;
}

/* Controls Bar */
.controls-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1f2937;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.controls-bar .back-link {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.875rem;
}

.controls-bar .back-link:hover {
  color: white;
}

.controls-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.controls-row select {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #4b5563;
  background: #374151;
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-print,
.btn-fullscreen {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  background: #4b5563;
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-print:hover,
.btn-fullscreen:hover {
  background: #6b7280;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: #6b7280;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scorecard Page */
.scorecard-page {
  max-width: 1200px;
  margin: 1.5rem auto;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

/* Header */
.scorecard-header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 2rem;
  background: white;
  border-bottom: 4px solid #d97706;
  overflow: hidden;
}

.header-logo {
  width: 60px;
  height: 60px;
}

.logo-img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.header-title h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.375rem;
  letter-spacing: -0.01em;
}

.header-title .subtitle {
  font-size: 0.9375rem;
  color: #6b7280;
  font-style: italic;
  font-weight: 400;
}

.header-date {
  text-align: right;
}

.header-date .date-label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-date .date-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
}

/* Top Section - Company Goals + Charter */
.top-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid #d1d5db;
  border-top: 1px solid #d1d5db;
}

.company-goals-box {
  border-right: 1px solid #d1d5db;
  display: flex;
  flex-direction: column;
}

.charter-box {
  display: flex;
  flex-direction: column;
}

.section-title-bar {
  background: linear-gradient(to bottom, #fbbf24, #f59e0b);
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
  letter-spacing: 0.01em;
  border-bottom: 1px solid #d97706;
}

.company-goals-list {
  padding: 1.25rem 1.25rem 1.25rem 2.5rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.8;
  flex: 1;
}

.company-goals-list li {
  margin-bottom: 0.75rem;
  color: #1f2937;
}

.company-goals-list li:last-child {
  margin-bottom: 0;
}

.charter-section {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #d1d5db;
  flex: 1;
}

.charter-section:last-child {
  border-bottom: none;
}

.charter-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.charter-text {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.6;
}

/* Table Sections */
.table-section {
  border-bottom: 1px solid #e5e7eb;
}

.table-section:last-of-type {
  border-bottom: none;
}

/* Scorecard Tables */
.scorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
}

.scorecard-table th {
  background: #f3f4f6;
  padding: 0.625rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #1f2937;
  border: 1px solid #d1d5db;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.scorecard-table td {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  vertical-align: top;
  line-height: 1.5;
}

.scorecard-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.scorecard-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.scorecard-table tbody tr:hover {
  background: #f3f4f6;
}

/* Column widths */
.col-num {
  width: 45px;
  text-align: center;
  font-weight: 600;
  color: #374151;
}

.col-statement {
  width: 38%;
  color: #1f2937;
}

.col-criteria {
  width: 36%;
  color: #4b5563;
}

.col-status {
  width: 100px;
  text-align: center;
}

.col-bsc {
  width: 80px;
  text-align: center;
  font-size: 0.75rem;
  color: #374151;
  font-weight: 500;
}

/* Colored BSC indicator square */
.bsc-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.col-metric {
  width: 40%;
}

.col-current,
.col-target {
  width: 15%;
  text-align: center;
}

/* Status Pills - Text-based like PDF */
.status-pill {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.status-on_track {
  color: #059669;
}

.status-at_risk {
  color: #d97706;
}

.status-off_track {
  color: #dc2626;
}

.status-completed {
  color: #4f46e5;
}

.status-not_started {
  color: #6b7280;
}

/* Empty rows */
.empty-row {
  text-align: center;
  color: #9ca3af;
  font-style: italic;
  padding: 1.5rem;
  background: #fafafa;
}

/* Footer */
.scorecard-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #f9fafb;
  font-size: 0.75rem;
  color: #9ca3af;
  border-top: 1px solid #e5e7eb;
}

/* Fullscreen Mode */
body.fullscreen .controls-bar {
  display: none;
}

body.fullscreen .scorecard-page {
  max-width: 100%;
  margin: 0;
  border-radius: 0;
  min-height: 100vh;
}

body.fullscreen {
  background: white;
}

/* Print Styles */
@media print {
  .controls-bar {
    display: none !important;
  }

  body {
    background: white;
  }

  .scorecard-page {
    max-width: 100%;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .scorecard-header {
    background: white !important;
    border-bottom: 4px solid #d97706 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .section-title-bar {
    background: linear-gradient(to bottom, #fbbf24, #f59e0b) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .bsc-indicator {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .scorecard-table tbody tr:nth-child(even) {
    background: #f9fafb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .scorecard-table {
    border: 1px solid #d1d5db !important;
  }

  .scorecard-table th {
    background: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .scorecard-table td {
    border: 1px solid #d1d5db !important;
  }

  .status-pill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .status-on_track {
    color: #059669 !important;
  }

  .status-at_risk {
    color: #d97706 !important;
  }

  .status-off_track {
    color: #dc2626 !important;
  }

  .status-completed {
    color: #4f46e5 !important;
  }

  .status-not_started {
    color: #6b7280 !important;
  }

  .top-section {
    border-top: 1px solid #d1d5db !important;
    border-bottom: 1px solid #d1d5db !important;
  }

  .company-goals-box {
    border-right: 1px solid #d1d5db !important;
  }

  .charter-section {
    border-bottom: 1px solid #d1d5db !important;
  }

  .table-section {
    page-break-inside: avoid;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .scorecard-page {
    margin: 0.5rem;
    border-radius: 0;
  }

  .top-section {
    grid-template-columns: 1fr;
  }

  .company-goals-box {
    border-right: none;
    border-bottom: 1px solid #d1d5db;
  }

  .scorecard-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0.75rem;
  }

  .header-logo {
    margin: 0 auto;
  }

  .header-date {
    text-align: center;
  }

  .scorecard-table {
    font-size: 0.75rem;
  }

  .col-criteria {
    display: none;
  }

  .col-statement {
    width: 60%;
  }
}

@media (max-width: 600px) {
  .controls-row {
    flex-wrap: wrap;
  }

  .controls-row select {
    width: 100%;
  }
}
