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

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: #0d2339;
  color: #fff;
  padding: 0px 28px;
  display: flex;
  align-items: center;
  justify-content: start;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.header-left h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-left p {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 3px;
}

.header-stats {
  display: flex;
  gap: 0px;
  flex-wrap: wrap;
  margin-left: 50px;
}

.header-end select {
  margin-bottom: 5px;
}

.header-end select option {
  background: white;
  color: #000;
}

.stat-box {
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  padding: 15px 20px;
}

.stat-box:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.stat-box .val {
  font-size: 2rem;
  font-weight: 800;
}

.stat-box .lbl {
  font-size: 0.75rem;
  opacity: 1;
  letter-spacing: 0.5px;
}

.last-updated {
  font-size: 0.75rem;
  align-self: flex-center;
  margin-left: auto;
}

/* ── Main Container ── */
.main-container {
  display: flex;
  gap: 20px;
  padding: 10px 10px 40px;
  background: #fff;
  border-radius: 0 6px 0 0;
}

/* ── Board wrapper ── */
.board-wrap {
  flex: 1;
  overflow-x: auto;
  padding: 4px 8px;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 14px;
  min-width: 1100px;
}

/* ── Filter Panel ── */
.filter-panel {
  width: 280px;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.filter-panel h2 {
  font-size: 1.3rem;
  color: #1a3a5c;
  margin-bottom: 20px;
  padding-bottom: 10px;
}
.btn-clear {
  color: #8d248e;
  font-size: 13px;
  font-weight: 600;
}
.btn-clear:hover {
  text-decoration: underline;
  cursor: pointer;
}
.filter-section {
  margin-bottom: 20px;
}

.filter-section h3 {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 12px;
  font-weight: 600;
}

.filter-dropdown {
  margin-bottom: 15px;
}

.filter-dropdown-header {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.filter-dropdown-header:hover {
  background: #ebebeb;
}

.filter-dropdown-header .arrow {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.filter-dropdown-header.active .arrow {
  transform: rotate(180deg);
}

.filter-dropdown-content {
  display: none;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: -6px;
}

.filter-dropdown-content.active {
  display: block;
}

.filter-option {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}

.filter-option:hover {
  background: #f9f9f9;
}

.filter-option input[type="checkbox"] {
  cursor: pointer;
}

.filter-option label {
  cursor: pointer;
  flex: 1;
}

/* ── Column ── */
.col {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.col-header {
  background: #092780;
  /* ≈ #092780 (close to #92278 padded to 6 digits) */
  color: #fff;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.3px;
}

.col-header .badge {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.col-body {
  background: #fff;
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

/* ── Deal Card ── */
.card {
  background: #e2f0d9;
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 4px solid #5aaa3b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  cursor: default;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.card.closed-lost {
  background: #ffcccc;
  border-left-color: #cc0000;
}

.card.overdue {
  background: #fd8989;
  border-left-color: #d32f2f;
}

.card.urgent {
  background: #fee38a;
  border-left-color: #f0ad4e;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1a2f4e;
  line-height: 1.3;
  margin-bottom: 7px;
}
.account-name {
  font-size: 0.8rem;
  color: #000;
  line-height: 1.3;
  margin-bottom: 7px;
}
.card-meta {
  font-size: 0.73rem;
  color: #3a4a5a;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.chip {
  color: #000;
  border-radius: 4px;
  padding: 1px 0px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.separator {
  color: #000;
  font-size: 0.65rem;
}

/* ── Empty state ── */
.empty {
  text-align: center;
  color: #aaa;
  font-size: 0.8rem;
  padding: 20px 0;
}

/* ── Loading overlay ── */
#loading {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-size: 1rem;
  color: #555;
  gap: 14px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 5px solid #ddd;
  border-top-color: #092780;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Footer ── */
.footer {
  text-align: center;
  font-size: 0.72rem;
  color: #888;
  padding: 10px 0 20px;
}

/* ── Tabs ── */
.tabs-container {
  /* background: #fff; */
  /* border-bottom: 2px solid #e0e0e0; */
  margin: 10px 0px 0;
  display: flex;
}

.tabs {
  display: flex;
  gap: 2px;
}

.tab {
  padding: 6px 30px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #8b8b8b;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  background: #e3e3e3;
  border-radius: 8px 8px 0px 0px;
  /* border: 2px solid #ededed; */
}

.tab:hover {
  color: #092780;
  background: #fff;
}

.tab.active {
  color: #092780;
  border-bottom-color: #092780;
  background: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.report-tab-content {
  display: none;
}

.report-tab-content.active {
  display: block;
}

.report-tab-content {
  background: #fff;
}

#reports .tabs-container {
  padding: 0 0 0 35px !important;
  margin: 0px;
}
#reports .tab {
  background: transparent;
  border: none;
  color: #666;
  padding: 10px 30px 0;
  font-size: 14px;
}
#reports .tab-area {
  background: #fff;
}

#reports .report-tab span.active {
  color: #89218d;
  border-bottom: 2px solid #89218d;
  display: inline-block;
  padding-bottom: 8px;
}

#reports .report-tab span {
  display: inline-block;
}

/* ── Print Styles ── */
/* @media print {
  * {
    margin: 0;
    padding: 0;
  }

  body {
    background: #fff;
    min-height: auto;
    width: 100%;
    overflow: visible;
  }

  .header {
    padding: 10px 15px;
    box-shadow: none;
    border-bottom: 2px solid #ddd;
  }

  .header-end {
    display: none !important;
  }

  .main-container {
    display: block;
    padding: 15px;
    gap: 0;
  }

  .board-wrap {
    flex: 1;
    overflow: visible !important;
    width: 100%;
    margin-bottom: 20px;
  }

  .board {
    display: block;
    grid-template-columns: none;
    gap: 0;
    min-width: auto;
    width: 100%;
  }

  .col {
    display: block;
    margin-bottom: 20px;
    page-break-inside: avoid;
    page-break-after: always;
    border: 1px solid #ddd;
    width: 100%;
  }

  .col:last-child {
    page-break-after: avoid;
  }

  .col-header {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .col-body {
    padding: 8px;
    min-height: auto;
  }

  .card {
    margin-bottom: 8px;
    padding: 8px 10px;
    font-size: 0.75rem;
    page-break-inside: avoid;
  }

  .filter-panel {
    display: none !important;
  }

  .tabs-container {
    display: none !important;
  }

  #loading {
    display: none !important;
  }

  .spinner {
    display: none !important;
  }

  @page {
    margin: 0.5in;
    size: auto;
  }
} */

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

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
  }

  /* @page {
    size: landscape;
    margin: 0.3in;
  } */

  /* ---------------- HEADER ---------------- */
  .header {
    padding: 5px 10px;
    border-bottom: 1px solid #ccc;

    page-break-after: avoid !important;
    break-after: avoid-page !important;
  }

  .header h1,
  .header h2,
  .header p {
    margin: 0 !important;
  }

  /* ---------------- BOARD ---------------- */
  .board {
    display: flex;
    flex-wrap: nowrap !important;
    width: 100%;
    gap: 5px;

    margin: 0 !important;

    page-break-before: avoid !important;
    break-before: avoid-page !important;
  }

  .col {
    flex: 1;
    border: 1px solid #ddd;

    page-break-inside: avoid;
    break-inside: avoid;
  }
  .col-header {
    font-size: 14px !important;
  }
  /* ---------------- PREVENT SPLIT ---------------- */
  .header,
  .board {
    break-inside: avoid-page;
  }

  /* ---------------- HIDE UI ---------------- */
  .filter-panel,
  .tabs-container,
  #loading,
  .spinner {
    display: none !important;
  }
}
