/**
 * Investment Calculator Stylesheet
 * Pixel-perfect Calculator.net clone matching target design
 */

/* Container & Layout */
.inv-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 16px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  box-sizing: border-box;
}

/* Breadcrumbs & Top Bar */
.inv-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 8px;
}

.inv-breadcrumbs {
  color: #0844a4;
}

.inv-breadcrumbs a {
  color: #0844a4;
  text-decoration: none;
}

.inv-breadcrumbs a:hover {
  text-decoration: underline;
}

.inv-breadcrumbs .sep {
  color: #888888;
  margin: 0 4px;
}

.inv-breadcrumbs .current {
  color: #555555;
}

.inv-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inv-saved-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #2b5a88;
  background: #f5f7fa;
  border: 1px solid #ccd5df;
  border-radius: 3px;
  padding: 3px 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.inv-saved-btn:hover {
  background: #eaf0f7;
  border-color: #a9b9cb;
}

.inv-print-link {
  font-size: 13px;
  color: #0844a4;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.inv-print-link:hover {
  color: #cc0000;
}

/* Page Title & Intro */
.inv-page-title {
  font-size: 24px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.inv-intro-text {
  font-size: 13px;
  line-height: 1.45;
  color: #222222;
  margin: 0 0 16px 0;
  max-width: 820px;
}

/* Main Two-Column Layout */
.inv-main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.inv-content-col {
  flex: 1;
  min-width: 0;
}

/* ==========================================================================
   TABS & CALCULATOR BOX
   ========================================================================== */
.inv-calc-box-wrapper {
  margin-bottom: 24px;
}

/* Tab Bar */
.inv-tab-bar {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #7f9db9;
}

.inv-tab-item {
  margin: 0 2px 0 0;
}

.inv-tab-btn {
  display: inline-block;
  background: #2b5a88;
  color: #ffffff;
  border: 1px solid #7f9db9;
  border-bottom: none;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.inv-tab-btn:hover {
  background: #1b4570;
}

.inv-tab-btn.active {
  background: #ffffff;
  color: #000000;
  border-bottom: 1px solid #ffffff;
  margin-bottom: -1px;
  cursor: default;
}

/* Main Box Container */
.inv-calc-box {
  border: 1px solid #7f9db9;
  border-top: none;
  background: #ffffff;
  padding: 16px 14px 18px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Left Form Column */
.inv-form-side {
  flex: 1;
  min-width: 290px;
}

.inv-form-table {
  width: 100%;
  border-collapse: collapse;
}

.inv-form-table td {
  padding: 5px 2px;
  font-size: 12.5px;
  color: #222222;
  vertical-align: middle;
}

.inv-form-table td.inv-label-col {
  width: 145px;
  text-align: left;
  font-weight: normal;
  color: #333333;
}

.inv-form-table td.inv-input-col {
  text-align: left;
}

/* Input Fields & Groups */
.inv-input-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #7f9db9;
  height: 24px;
  box-sizing: border-box;
  width: 155px;
}

.inv-input-prefix {
  padding: 0 4px;
  font-size: 12px;
  color: #555555;
  user-select: none;
}

.inv-input-suffix {
  border-left: 1px solid #d4dbe0;
  background-color: #f7f9fa;
  padding: 0 6px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 11px;
  color: #555555;
}

.inv-input {
  border: none;
  outline: none;
  padding: 0 4px;
  font-size: 12px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  font-family: inherit;
  color: #111111;
}

.inv-input.text-right {
  text-align: right;
}

.inv-select {
  border: 1px solid #7f9db9;
  background: #ffffff;
  height: 24px;
  font-size: 12px;
  color: #111111;
  padding: 0 4px;
  width: 155px;
  box-sizing: border-box;
  font-family: inherit;
}

/* Radio Option Groups */
.inv-radio-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: #222222;
}

.inv-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.inv-radio-group input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

/* Button Row */
.inv-btn-row {
  margin-top: 10px;
  padding-left: 147px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.inv-calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #3b7b25;
  border: 1px solid #2e621d;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.inv-calc-btn:hover {
  background: #2e621d;
}

.inv-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f8;
  border: 1px solid #7f9db9;
  color: #333333;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}

.inv-clear-btn:hover {
  background: #e5e9ed;
}

/* ==========================================================================
   RESULTS PANEL (RIGHT SIDE OF BOX)
   ========================================================================== */
.inv-results-side {
  flex: 1.1;
  min-width: 320px;
  border: 1px solid #d4dbe0;
  border-radius: 3px;
  background: #ffffff;
  overflow: hidden;
}

/* Results Header Bar */
.inv-results-header {
  background: #5c9038;
  color: #ffffff;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-results-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.2px;
}

.inv-save-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 11px;
  font-weight: normal;
  padding: 2px 7px;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.inv-save-link-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Results Body */
.inv-results-body {
  padding: 12px 14px 16px;
}

.inv-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}

.inv-summary-table td {
  padding: 4px 2px;
  font-size: 13px;
}

.inv-summary-table td.label {
  color: #333333;
  font-weight: normal;
}

.inv-summary-table td.val {
  text-align: right;
  font-weight: bold;
  color: #000000;
}

.inv-summary-table tr.primary-row td {
  font-size: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.inv-summary-table tr.primary-row td.val {
  font-size: 17px;
  color: #000000;
}

/* Donut Chart & Legend */
.inv-chart-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
}

.inv-donut-canvas-container {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.inv-donut-canvas {
  width: 130px;
  height: 130px;
  display: block;
}

.inv-chart-legend {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #333333;
}

.inv-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.inv-legend-color {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
}

.inv-legend-color.blue {
  background-color: #2b74c4;
}

.inv-legend-color.green {
  background-color: #73a839;
}

.inv-legend-color.red {
  background-color: #a61c1c;
}

/* ==========================================================================
   ACCUMULATION SCHEDULE & STACKED BAR CHART
   ========================================================================== */
.inv-schedule-section {
  margin-top: 24px;
}

.inv-schedule-title {
  font-size: 18px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 10px 0;
}

/* Schedule Sub-Tabs */
.inv-schedule-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
}

.inv-schedule-tab-link {
  color: #0844a4;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-family: inherit;
}

.inv-schedule-tab-link.active {
  font-weight: bold;
  color: #000000;
  text-decoration: none;
  cursor: default;
}

/* Schedule Two Columns */
.inv-schedule-cols {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Table Wrap */
.inv-table-side {
  flex: 1.1;
  min-width: 320px;
}

.inv-table-scroll {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #cccccc;
  background: #ffffff;
}

.inv-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.inv-data-table thead {
  position: sticky;
  top: 0;
  background-color: #1f4f82;
  color: #ffffff;
  z-index: 10;
}

.inv-data-table th {
  padding: 6px 8px;
  font-weight: bold;
  text-align: right;
  border: 1px solid #7f9db9;
}

.inv-data-table th:first-child {
  text-align: center;
  width: 50px;
}

.inv-data-table td {
  padding: 5px 8px;
  border: 1px solid #e0e0e0;
  text-align: right;
  color: #222222;
}

.inv-data-table td:first-child {
  text-align: center;
  font-weight: bold;
}

.inv-data-table tbody tr:nth-child(even) {
  background-color: #f7fafc;
}

.inv-data-table tbody tr:hover {
  background-color: #eef3f8;
}

/* Chart Side */
.inv-chart-side {
  flex: 1;
  min-width: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.inv-bar-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #333333;
}

.inv-barchart-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 250px;
  background: #ffffff;
}

.inv-barchart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.inv-barchart-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
  display: none;
  z-index: 50;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ==========================================================================
   SIDEBAR STYLING
   ========================================================================== */
.inv-sidebar-col {
  width: 260px;
  flex-shrink: 0;
}

.inv-search-box {
  display: flex;
  height: 26px;
  margin-bottom: 12px;
}

.inv-search-input {
  flex: 1;
  border: 1px solid #7f9db9;
  border-right: none;
  padding: 0 8px;
  font-size: 12px;
  outline: none;
  font-family: inherit;
  color: #111111;
  min-width: 0;
}

.inv-search-btn {
  background: #2b5a88;
  color: #ffffff;
  border: 1px solid #1b4570;
  padding: 0 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}

.inv-search-btn:hover {
  background: #1b4570;
}

.inv-search-dropdown {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #7f9db9;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}

.inv-search-result-item {
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-search-result-item:hover {
  background: #eef3f8;
}

.inv-search-result-cat {
  font-size: 10.5px;
  color: #888888;
}

/* Financial Calculators Card */
.inv-sidebar-card {
  border: 1px solid #7f9db9;
  background: #ffffff;
}

.inv-sidebar-header {
  background: #2b5a88;
  color: #ffffff;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 10px;
}

.inv-sidebar-content {
  padding: 10px;
}

.inv-sidebar-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 6px;
  column-gap: 8px;
  font-size: 12px;
}

.inv-sidebar-links-grid a {
  color: #0844a4;
  text-decoration: underline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-sidebar-links-grid a:hover {
  color: #cc0000;
}

.inv-sidebar-more {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dotted #cccccc;
  font-size: 12px;
}

.inv-sidebar-more a {
  color: #0844a4;
  text-decoration: underline;
}

.inv-sidebar-more a:hover {
  color: #cc0000;
}

.inv-sidebar-cats {
  background: #f4f6f8;
  border-top: 1px solid #d4dbe0;
  padding: 8px 10px;
  font-size: 11px;
  text-align: center;
  color: #666666;
}

.inv-sidebar-cats a {
  color: #0844a4;
  text-decoration: underline;
}

.inv-sidebar-cats a:hover {
  color: #cc0000;
}

.inv-sidebar-cats .sep {
  margin: 0 3px;
  color: #999999;
}

/* ==========================================================================
   MODALS: SAVED & PRINT
   ========================================================================== */
.inv-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  box-sizing: border-box;
}

.inv-modal-dialog {
  background: #ffffff;
  border: 1px solid #7f9db9;
  border-radius: 4px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.inv-modal-dialog-lg {
  max-width: 820px;
  width: 95%;
  max-height: 90vh;
}

.inv-modal-header {
  background: #2b5a88;
  color: #ffffff;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 3px 3px 0 0;
}

.inv-modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
}

.inv-modal-close-icon {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.inv-modal-body {
  padding: 14px;
  overflow-y: auto;
  font-size: 12px;
  color: #333333;
}

.inv-modal-footer {
  background: #f4f6f8;
  border-top: 1px solid #d4dbe0;
  padding: 8px 14px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  border-radius: 0 0 4px 4px;
}

.inv-modal-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid #7f9db9;
  background: #ffffff;
  color: #333333;
}

.inv-modal-btn.primary {
  background: #2b5a88;
  border-color: #1b4570;
  color: #ffffff;
}

.inv-modal-btn.primary:hover {
  background: #1b4570;
}

/* Saved Items List */
.inv-saved-empty {
  padding: 24px;
  text-align: center;
  color: #777777;
  font-style: italic;
}

.inv-saved-item {
  border: 1px solid #d4dbe0;
  border-radius: 3px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fbfbfc;
}

.inv-saved-item:hover {
  background: #f2f6fa;
}

.inv-saved-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.inv-saved-item-title {
  font-weight: bold;
  color: #0844a4;
  font-size: 13px;
}

.inv-saved-item-date {
  font-size: 11px;
  color: #888888;
}

.inv-saved-item-details {
  font-size: 11.5px;
  color: #444444;
  margin-bottom: 8px;
  line-height: 1.4;
}

.inv-saved-item-actions {
  display: flex;
  gap: 8px;
}

.inv-btn-sm {
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid #7f9db9;
  background: #ffffff;
}

.inv-btn-sm.load {
  background: #2b5a88;
  border-color: #1b4570;
  color: #ffffff;
}

.inv-btn-sm.delete {
  color: #cc0000;
  border-color: #e0b4b4;
}

/* Print Toolbar */
.inv-print-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  background-color: #f8fafc;
  padding: 8px 10px;
  border-radius: 3px;
  border: 1px solid #e0e5eb;
}

.inv-print-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #7f9db9;
  padding: 5px 12px;
  font-size: 12px;
  color: #003366;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
}

.inv-print-action-btn:hover {
  background: #eef3f8;
  border-color: #003366;
}

.inv-print-action-btn.inv-btn-print-now {
  background: #5c9038;
  border-color: #4a752d;
  color: #ffffff;
}

.inv-print-action-btn.inv-btn-print-now:hover {
  background: #4a752d;
}

.inv-print-sheet {
  background: #ffffff;
  padding: 6px 2px;
  color: #111111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.45;
}

.inv-print-tip {
  font-size: 11px;
  color: #666666;
  margin-right: auto;
  align-self: center;
}

/* Toast */
.inv-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #222222;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 2000;
  display: none;
  animation: invFadeIn 0.2s ease;
}

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

/* ==========================================================================
   PRINT MEDIA QUERY
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .site-header,
  .site-footer,
  .inv-top-bar,
  .inv-sidebar-col,
  .inv-top-actions,
  .inv-btn-row,
  .inv-toast,
  .inv-print-toolbar,
  .inv-print-tip,
  .inv-modal-footer,
  .inv-modal-close-icon {
    display: none !important;
  }

  /* When printing from modal */
  body.inv-printing-modal .inv-page-container {
    display: none !important;
  }

  body.inv-printing-modal .inv-modal-backdrop {
    position: static !important;
    background: transparent !important;
    display: block !important;
    padding: 0 !important;
  }

  body.inv-printing-modal .inv-modal-dialog {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: none !important;
  }

  body.inv-printing-modal .inv-modal-body {
    overflow: visible !important;
    padding: 0 !important;
  }

  .inv-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .inv-main-layout {
    display: block !important;
  }

  .inv-calc-box {
    border: 1px solid #888 !important;
    page-break-inside: avoid !important;
  }

  .inv-table-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  .inv-data-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .inv-data-table th,
  .inv-data-table td {
    border: 1px solid #555 !important;
    color: #000 !important;
    padding: 4px 6px !important;
  }

  .inv-data-table tr {
    page-break-inside: avoid !important;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 860px) {
  .inv-main-layout {
    flex-direction: column;
  }

  .inv-sidebar-col {
    width: 100%;
    margin-top: 24px;
  }

  .inv-calc-box {
    flex-direction: column;
  }

  .inv-results-side {
    width: 100%;
  }

  .inv-schedule-cols {
    flex-direction: column;
  }

  .inv-chart-side {
    width: 100%;
  }
}

@media (max-width: 580px) {
  .inv-btn-row {
    padding-left: 0;
  }

  .inv-form-table td.inv-label-col {
    width: 110px;
    font-size: 11.5px;
  }

  .inv-input-group,
  .inv-select {
    width: 130px;
  }

  .inv-tab-btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
}
