/* ============================================================
   Reports V2 — Card-based hub styles
   ============================================================ */

/* --- Report page: white card with rounded corners, margins, full height --- */
#pageReport {
  background: #ffffff !important;
  border-radius: 12px !important;
  margin: 10px 0 10px 10px !important;
  width: calc(100% - 26px) !important;
  min-height: calc(100vh - 65px) !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  overflow-y: auto !important;
  overflow-x: visible !important;
}

#pageReport .settings-page {
  padding: 16px 20px 60px 20px !important;
  background: #ffffff !important;
  min-height: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

#pageReport .v2-nav-header.settings-header-rounded {
  margin: 0 0 20px 0 !important;
  justify-content: flex-start !important;
  padding: 0 !important;
}

#pageReport .page-region-content {
  padding: 4px 0 0 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: #ffffff !important;
  overflow: visible !important;
}

/* Override global .page-control .frames .frame { padding:15px } from modern.css */
#pageReport .frames,
#pageReport .formFrame,
#pageReport .frame {
  padding: 0 !important;
  margin: 0 !important;
  background: #ffffff !important;
  overflow: visible !important;
}


/* --- Report Hub Container --- */
.v2-report-hub {
  padding: 20px 16px;
  max-width: 900px;
  margin: 0 auto;
}

.v2-report-hub-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-report-hub-title i {
  color: #3b82f6;
}

/* --- Report Card Grid --- */
.v2-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

/* --- Individual Report Card --- */
.v2-report-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.v2-report-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
}

.v2-report-card:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.1);
}

/* Card Icon */
.v2-report-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.v2-report-card-icon.icon-blue {
  background: #3b82f6;
  color: #ffffff;
}

.v2-report-card-icon.icon-green {
  background: #22c55e;
  color: #ffffff;
}

.v2-report-card-icon.icon-purple {
  background: #8b5cf6;
  color: #ffffff;
}

.v2-report-card-icon.icon-orange {
  background: #f97316;
  color: #ffffff;
}

.v2-report-card-icon.icon-teal {
  background: #14b8a6;
  color: #ffffff;
}

.v2-report-card-icon.icon-rose {
  background: #f43f5e;
  color: #ffffff;
}

/* Card Title */
.v2-report-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  line-height: 1.3;
}

/* Card Description */
.v2-report-card-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .v2-report-grid {
    grid-template-columns: 1fr;
  }

  .v2-report-hub {
    padding: 16px 12px;
  }
}

/* ============================================================
   Reports V2 — Filter/Form Styles (individual report pages)
   ============================================================ */

/* --- Back button in report detail pages (matches scrolltab arrows) --- */
#pageReport .nav-back-button {
  position: relative !important;
  left: auto !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  flex-shrink: 0;
  background-color: #ffffff !important;
  border-radius: 50% !important;
  border: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

#pageReport .nav-back-button::before {
  content: "" !important;
  display: block !important;
  width: 12px !important;
  height: 12px !important;
  border-left: 3px solid #2b5797 !important;
  border-bottom: 3px solid #2b5797 !important;
  transform: rotate(45deg) !important;
  margin-left: 4px !important;
  transition: border-color 0.2s ease !important;
}

#pageReport .nav-back-button:hover {
  background-color: #2b5797 !important;
  border-color: #2b5797 !important;
  transform: scale(1.1) !important;
  box-shadow: 0 6px 18px rgba(43, 87, 151, 0.3) !important;
}

#pageReport .nav-back-button:hover::before {
  border-color: #ffffff !important;
}
/* --- Filter form layout --- */
.v2-report-filters {
  padding: 0;
  min-height: 420px;
  padding-bottom: 80px;
  position: relative;
}

.v2-report-filter-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
}

.v2-report-filter-row:first-child {
  z-index: 30;
}

.v2-report-filter-row:nth-child(2) {
  z-index: 10;
}

.v2-report-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v2-report-filter-group.hide {
  display: none !important;
}

.v2-report-filter-group h4 {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin: 0;
}

.v2-report-filter-group .v2-select-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.v2-report-filter-group .v2-select {
  width: 100%;
  padding: 9px 36px 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  background-color: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}

.v2-report-filter-group .v2-select:hover {
  border-color: #94a3b8;
}

.v2-report-filter-group .v2-select:focus {
  outline: none;
  border-color: #3b5998;
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.12);
}

/* --- Date inputs in reports --- */
.v2-report-filter-group .v2-date-input {
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  background-color: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.v2-report-filter-group .v2-date-input:focus {
  outline: none;
  border-color: #3b5998;
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.12);
}

/* --- Checkbox label --- */
.v2-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  padding-top: 28px;
}

/* --- Section title (e.g. "Payments options") --- */
.v2-report-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin: 8px 0 12px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

/* --- Action buttons row --- */
.v2-report-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.v2-btn-primary {
  padding: 0 24px;
  height: 42px;
  min-height: 42px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: linear-gradient(135deg, #3b5998, #2b4583);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.v2-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 89, 152, 0.3);
}

.v2-btn-secondary {
  padding: 0 24px;
  height: 42px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.v2-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* --- Chart containers --- */
.v2-report-chart-container {
  margin-top: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .v2-report-filter-row {
    grid-template-columns: 1fr;
  }

  .v2-checkbox-label {
    padding-top: 0;
  }

  .v2-report-actions {
    flex-direction: column;
  }

  .v2-btn-primary,
  .v2-btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* --- Multi-select component in reports --- */
.v2-multiselect-wrap {
  position: relative;
  width: 100%;
}

.v2-multiselect-btn {
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  background-color: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 38px;
}

.v2-multiselect-btn:hover {
  border-color: #94a3b8;
}

.v2-multiselect-btn:focus,
.v2-multiselect-wrap.open .v2-multiselect-btn {
  outline: none;
  border-color: #3b5998;
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.12);
}

.v2-multiselect-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.v2-multiselect-caret {
  color: #64748b;
  font-size: 12px;
  margin-left: 8px;
  transition: transform 0.2s;
}

.v2-multiselect-wrap.open .v2-multiselect-caret {
  transform: rotate(180deg);
}

.v2-multiselect-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.22), 0 8px 16px -6px rgba(15, 23, 42, 0.12);
  z-index: 1000;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.v2-multiselect-search-wrap {
  padding: 8px 10px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.v2-multiselect-search-input {
  width: 100%;
  padding: 8px 10px 8px 30px;
  font-size: 12.5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  color: #1e293b;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 9px center;
  transition: border-color 0.15s, background-color 0.15s;
}

.v2-multiselect-search-input:focus {
  border-color: #3b5998;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(59, 89, 152, 0.12);
}

.v2-multiselect-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.v2-multiselect-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-size: 13.5px;
  color: #1e293b;
  user-select: none;
}

.v2-multiselect-item:hover {
  background-color: #f1f5f9;
}

.v2-multiselect-item.is-selected {
  background-color: #eff6ff;
  color: #1e40af;
  font-weight: 600;
}

.v2-multiselect-item input[type="checkbox"] {
  cursor: pointer;
  margin: 0;
  width: 17px;
  height: 17px;
  accent-color: #2b5797;
  flex-shrink: 0;
}

.v2-multiselect-item-label {
  cursor: pointer;
  flex: 1;
  margin: 0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-multiselect-item.is-selected .v2-multiselect-item-label {
  font-weight: 600;
  color: #1e40af;
}

.v2-multiselect-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 0;
}

/* --- Limit warning banner for large PDF reports --- */
.v2-report-limit-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.45;
}

.v2-report-limit-hint i {
  font-size: 16px;
  color: #dc2626;
  margin-top: 2px;
  flex-shrink: 0;
}


