/* Landlord Input Data Screen - minimal, embeddable CSS */
:root {
  --ll-font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --ll-bg: #ffffff;
  --ll-text: #111827;
  --ll-muted: #6b7280;
  --ll-border: #e5e7eb;
  --ll-primary: #2563eb;
  --ll-focus: #1d4ed8;
  --ll-card: #f9fafb;
  --ll-section-rental-bg: #f0fdf4; /* Light green */
  --ll-section-sale-bg: #fffbeb;   /* Light yellow */
  --ll-section-cash-bg: #eff6ff;   /* Light blue */
  --ll-section-ratios-bg: #fef2f2; /* Light red/pink for ratios */
}

*, *::before, *::after { box-sizing: border-box; }

.ll-wrap {
  font-family: var(--ll-font);
  color: var(--ll-text);
}

.ll-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
}

.ll-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ll-title {
  font-size: 20px;
  font-weight: 600;
}

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

.ll-btn {
  appearance: none;
  border: 1px solid var(--ll-border);
  background: #fff;
  color: var(--ll-text);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}
.ll-btn.primary {
  background: var(--ll-primary);
  border-color: var(--ll-primary);
  color: #fff;
}
.ll-btn:focus {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
}

.ll-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}
@media (min-width: 960px) {
  .ll-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ll-card {
  background: var(--ll-card);
  border: 1px solid var(--ll-border);
  border-radius: 12px;
  padding: 16px;
  max-width: 100%;
  overflow: hidden;
}

.ll-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 12px;
}
.ll-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ll-primary);
  color: white;
  font-weight: bold;
  font-size: 12px;
  margin-right: 8px;
}

/* Print Modal Styles */
.print-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden; /* Prevent any scrolling */
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

/* Prevent focus-related scrolling */
.print-modal input:focus,
.print-modal button:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Ensure modal container stays in place */
.print-modal-overlay:focus-within {
  position: fixed;
}

.print-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: translateZ(0); /* Force hardware acceleration to prevent jumping */
  will-change: transform; /* Additional optimization */
}

.print-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ll-border);
}

.print-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--ll-muted);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--ll-text);
}

.print-modal-body {
  padding: 24px;
}

.print-modal-body p {
  margin: 0 0 16px 0;
  color: var(--ll-text);
}

.print-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.print-option {
  border: 1px solid var(--ll-border);
  border-radius: 8px;
  padding: 16px;
  transition: border-color 0.2s;
}

.print-option:hover {
  border-color: var(--ll-primary);
}

.select-all-option {
  background: rgba(59, 130, 246, 0.05);
  border: 2px solid var(--ll-primary);
  font-weight: 600;
}

.select-all-option:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--ll-primary-hover);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin: 0;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ll-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark {
  background: var(--ll-primary);
  border-color: var(--ll-primary);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.option-content {
  flex: 1;
}

.option-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.option-description {
  font-size: 14px;
  color: var(--ll-muted);
}

.print-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px 24px;
  border-top: 1px solid var(--ll-border);
}

.ll-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .ll-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ll-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* allow shrinking in CSS grid on Safari/Chrome */
}
.ll-span-2 { grid-column: 1 / -1; }
.ll-label {
  font-size: 12px;
  color: var(--ll-muted);
}
.ll-input, .ll-select, .ll-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ll-border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  max-width: 100%;
}
.ll-display {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ll-border);
  border-radius: 8px;
  background: #e9ecef;
  font: inherit;
  max-width: 100%;
  color: var(--ll-text);
  cursor: default;
}
.ll-input:focus, .ll-select:focus, .ll-textarea:focus {
  border-color: var(--ll-focus);
  outline: 3px solid rgba(29, 78, 216, 0.2);
}

/* Yellow inputs for top sections (Rental Income, Operating Expenses, Property Costs, Financing, Income Taxes) */
.ll-grid > .ll-card:nth-child(1) .ll-input,
.ll-grid > .ll-card:nth-child(2) .ll-input,
.ll-grid > .ll-card:nth-child(3) .ll-input,
.ll-grid > .ll-card:nth-child(4) .ll-input,
.ll-grid > .ll-card:nth-child(5) .ll-input,
.ll-grid > .ll-card:nth-child(1) .ll-select,
.ll-grid > .ll-card:nth-child(2) .ll-select,
.ll-grid > .ll-card:nth-child(3) .ll-select,
.ll-grid > .ll-card:nth-child(4) .ll-select,
.ll-grid > .ll-card:nth-child(5) .ll-select,
.ll-grid > .ll-card:nth-child(1) .ll-textarea,
.ll-grid > .ll-card:nth-child(2) .ll-textarea,
.ll-grid > .ll-card:nth-child(3) .ll-textarea,
.ll-grid > .ll-card:nth-child(4) .ll-textarea,
.ll-grid > .ll-card:nth-child(5) .ll-textarea {
  background: #fefce8; /* Light yellow background */
  border-color: #eab308; /* Yellow border */
}

.ll-grid > .ll-card:nth-child(1) .ll-input:focus,
.ll-grid > .ll-card:nth-child(2) .ll-input:focus,
.ll-grid > .ll-card:nth-child(3) .ll-input:focus,
.ll-grid > .ll-card:nth-child(4) .ll-input:focus,
.ll-grid > .ll-card:nth-child(5) .ll-input:focus,
.ll-grid > .ll-card:nth-child(1) .ll-select:focus,
.ll-grid > .ll-card:nth-child(2) .ll-select:focus,
.ll-grid > .ll-card:nth-child(3) .ll-select:focus,
.ll-grid > .ll-card:nth-child(4) .ll-select:focus,
.ll-grid > .ll-card:nth-child(5) .ll-select:focus,
.ll-grid > .ll-card:nth-child(1) .ll-textarea:focus,
.ll-grid > .ll-card:nth-child(2) .ll-textarea:focus,
.ll-grid > .ll-card:nth-child(3) .ll-textarea:focus,
.ll-grid > .ll-card:nth-child(4) .ll-textarea:focus,
.ll-grid > .ll-card:nth-child(5) .ll-textarea:focus {
  border-color: #ca8a04; /* Darker yellow on focus */
  outline: 3px solid rgba(202, 138, 4, 0.2);
}
.ll-help {
  font-size: 11px;
  color: var(--ll-muted);
}

.ll-row-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 900px) {
  .ll-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ll-mortgages {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 960px) {
  .ll-mortgages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ll-mort-card {
  border: 1px dashed var(--ll-border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  min-width: 0;
}
.ll-mort-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.ll-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ll-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ll-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed; /* prevent wide cells from blowing out containers */
  background-color: transparent; /* Ensure table background doesn't interfere */
}
.ll-table th, .ll-table td {
  border-bottom: 1px solid var(--ll-border);
  padding: 8px 6px;
  text-align: left;
  word-break: break-word;
  background-color: transparent;
}
.ll-table tfoot td {
  font-weight: 600;
}

/* Zebra striping for Financial Ratios table columns */
.column-odd {
  background-color: #e9ecef;
}

.column-even {
  background-color: #ffffff;
}

/* Zebra striping for all tables */
.ll-table tbody tr:nth-child(even) > td,
.ll-table tbody tr:nth-child(even) > th {
  background-color: #e9ecef !important;
}

.ll-table tbody tr:nth-child(odd) > td,
.ll-table tbody tr:nth-child(odd) > th {
  background-color: #ffffff !important;
}

.ll-table thead th {
  background-color: #ffffff !important;
  border-bottom: 2px solid #e5e7eb;
}

.ll-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.ll-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Ensure grid children can shrink and not overflow cards */
.ll-fields > *, .ll-row-3 > *, .ll-mortgages > *, .ll-card > * {
  min-width: 0;
}

/* Styles for negative numbers and percentages */
.negative-number {
  color: #dc2626; /* red-600 */
  font-weight: 500;
}

.negative-percent {
  color: #dc2626; /* red-600 */
  font-weight: 500;
}

/* Tab Navigation Styles */
.tab-navigation {
  margin-bottom: 24px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


.tab-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  min-width: 90px;
  background: white;
  border: 2px solid #e2e8f0;
  color: var(--ll-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
  text-align: center;
}

.tab-button:hover {
  border-color: var(--ll-primary);
  background: rgba(37, 99, 235, 0.02);
  color: var(--ll-text);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.tab-button.active {
  background: linear-gradient(135deg, var(--ll-primary), var(--ll-focus));
  border-color: var(--ll-primary);
  color: white;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  transform: translateY(-2px);
}

.tab-button.active:hover {
  background: linear-gradient(135deg, var(--ll-focus), var(--ll-primary));
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}


.tab-icon {
  font-size: 18px;
  margin-bottom: 3px;
}

.tab-title {
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  max-width: 85px;
}

/* Tab Content */
.tab-content {
  padding-top: 8px;
}

/* Responsive tab design */
@media (max-width: 768px) {
  .tab-navigation {
    padding: 12px;
    margin-bottom: 16px;
  }

  .tab-buttons {
    gap: 4px;
    justify-content: center;
  }

  .tab-button {
    padding: 8px 4px;
    min-width: 60px;
    font-size: 9px;
  }

  .tab-icon {
    font-size: 14px;
  }

  .tab-title {
    font-size: 8px;
    max-width: 55px;
  }
}

/* Tab animations */
@keyframes tabSwitch {
  0% { transform: translateY(-2px) scale(0.98); }
  50% { transform: translateY(-4px) scale(1.02); }
  100% { transform: translateY(-2px) scale(1); }
}

.tab-content {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state for tab content */
.tab-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--ll-muted);
  font-size: 14px;
}

.tab-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--ll-border);
  border-top: 2px solid var(--ll-primary);
  border-radius: 50%;
  margin-right: 12px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Print styles: Executive Summary friendly */
@media print {
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ll-container { max-width: 100%; padding: 8px; }
  .ll-actions, .tab-navigation, .tab-content .ll-btn, .ll-note { display: none !important; }
  .ll-card { break-inside: avoid; page-break-inside: avoid; background: #fff; box-shadow: none; }
  .ll-header { margin-bottom: 8px; }
  .ll-grid { gap: 12px; }

  /* Chart container styles for print */
  .chart-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.1in;
    margin-bottom: 0.15in;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .chart-image {
    width: 100%;
    max-width: 6.5in;
    height: auto;
    border-radius: 2px;
  }

  .chart-placeholder {
    text-align: center;
    padding: 1in;
    color: #6b7280;
    font-style: italic;
    border: 1px dashed #d1d5db;
    border-radius: 4px;
  }

  /* Annual Cash Flow table print styles */
  .annual-cashflow-table {
    table-layout: auto !important; /* Override the global fixed layout */
  }

  .annual-cashflow-table th {
    font-size: 8px !important;
    padding: 2px 4px !important;
  }

  .annual-cashflow-table td {
    font-size: 7px !important;
    padding: 2px 4px !important;
  }

  .annual-cashflow-table th:nth-child(1),
  .annual-cashflow-table td:nth-child(1) {
    width: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
  }

  .annual-cashflow-table th:nth-child(2),
  .annual-cashflow-table td:nth-child(2),
  .annual-cashflow-table th:nth-child(3),
  .annual-cashflow-table td:nth-child(3),
  .annual-cashflow-table th:nth-child(4),
  .annual-cashflow-table td:nth-child(4),
  .annual-cashflow-table th:nth-child(5),
  .annual-cashflow-table td:nth-child(5),
  .annual-cashflow-table th:nth-child(6),
  .annual-cashflow-table td:nth-child(6),
  .annual-cashflow-table th:nth-child(7),
  .annual-cashflow-table td:nth-child(7) {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
  }

  /* Ending Page Layout */
  .ending-main {
    margin-top: 2px;
  }

  /* Services and Contact Sections - Compact for Print */
  .services-section {
    margin-top: 0px;
    margin-bottom: 2px;
  }

  .services-section h2 {
    font-size: 12px;
    margin: 0 0 2px 0;
    color: #333;
    font-weight: bold;
  }

  .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 1px;
    margin-bottom: 1px;
  }

  .service-card {
    background: #f8f9fa;
    padding: 1px;
    border-radius: 1px;
    text-align: center;
    border: 1px solid #e9ecef;
  }

  .service-icon {
    font-size: 11px;
    margin-bottom: 0px;
  }

  .service-card h3 {
    font-size: 8px;
    margin: 0px 0;
    color: #495057;
    line-height: 1.0;
  }

  .service-card p {
    font-size: 7px;
    margin: 0;
    color: #6c757d;
    line-height: 1.0;
  }

  .contact-section {
    margin-top: 0px;
    margin-bottom: 2px;
  }

  .contact-card {
    background: #f8f9fa;
    padding: 2px;
    border-radius: 1px;
    border: 1px solid #e9ecef;
  }

  .contact-card h3 {
    font-size: 11px;
    margin: 0 0 2px 0;
    color: #333;
    font-weight: bold;
  }

  .contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 1px;
    margin-bottom: 2px;
  }

  .contact-item {
    text-align: center;
  }

  .contact-label {
    font-size: 8px;
    font-weight: bold;
    color: #495057;
    margin-bottom: 0px;
  }

  .contact-link {
    font-size: 8px;
    color: #007bff;
    text-decoration: none;
  }

  .cta-section {
    text-align: center;
    margin-top: 1px;
  }

  .cta-text {
    font-size: 9px;
    font-weight: bold;
    color: #333;
    margin: 0 0 0px 0;
  }

  .cta-subtext {
    font-size: 8px;
    color: #6c757d;
    margin: 0;
    line-height: 1.0;
  }

  /* Disclaimer Section */
  .disclaimer-section {
    margin-top: 15px;
    page-break-inside: avoid;
  }

  .disclaimer-card {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 16px;
    margin: 10px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  .disclaimer-card h3 {
    color: #856404;
    font-size: 16px;
    margin: 0 0 12px 0;
    font-weight: bold;
    text-align: center;
  }

  .disclaimer-content {
    color: #212529;
    line-height: 1.4;
  }

  .disclaimer-content ul {
    margin: 12px 0;
    padding-left: 16px;
  }

  .disclaimer-content li {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .disclaimer-emphasis {
    background: #f8d7da;
    border-left: 3px solid #dc3545;
    padding: 8px 12px;
    margin: 12px 0 0 0;
    font-size: 12px;
    font-weight: bold;
    color: #721c24;
    text-align: center;
    line-height: 1.3;
  }

}
