.export-float{
  position: fixed;
  top: calc(var(--topbar-h, 56px) + 8px);
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none; /* cards manage their own */
}
.export-float .float-card{
  pointer-events: auto;
  min-width: 260px;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  transform: translateY(-10px);
  opacity: 0;
  animation: floatIn .35s ease both;
  transition: transform .2s ease, opacity .2s ease, height .2s ease, margin .2s ease, padding .2s ease;
}
.export-float .float-card:hover{ transform: scale(1.02); }
.float-card.gen{ background: #fff7e6; border-color: #ffd591; }
.float-card.ready{ background: #f6ffed; border-color: #b7eb8f; }
.float-card.error{ background: #fff1f0; border-color: #ffa39e; }
.float-card .name{ font-weight: 600; }
.float-card .meta{ font-size: 12px; color: var(--text-secondary); margin-top: 2px; display:flex; align-items:center; gap:6px; }
.float-card .actions{ display:flex; gap:8px; margin-top: 8px; justify-content:flex-end; }
@keyframes floatIn{ from{ transform: translateY(-10px); opacity:0;} to{ transform: translateY(0); opacity:1;} }

.export-float .float-card.leaving{ opacity:0; transform: translateY(-6px); height:0; margin:0; padding-top:0; padding-bottom:0; border-width:0; }

/* spinner for generating state */
.spinner{ width:16px; height:16px; border-radius:50%; border:2px solid rgba(0,0,0,.15); border-top-color: currentColor; animation: spin 1s linear infinite; }
.float-card.gen .spinner{ color: #fa8c16; }
.float-card.ready .spinner{ color: #52c41a; }
@keyframes spin{ to{ transform: rotate(360deg); } }
:root{
  
  --bg: #ffffff;
  --bg-secondary: #f7f6f3;
  --bg-tertiary: #f1f1ef;
  --panel: #ffffff;
  --line: #e9e9e7;
  --line-strong: #d4d4d1;
  --text: #000000;
  --text-secondary: #52524f;
  --text-tertiary: #6f6e6a;
  --text-quaternary: #c1c0ba;
  --muted: #9b9a97;
  --accent: #2383e2;
  --accent-hover: #1a73d1;
  --accent-light: #e7f3ff;
  --success: #0f7b0f;
  --success-light: #e7f5e7;
  --warning: #d9730d;
  --warning-light: #fff4e6;
  --danger: #e16259;
  --danger-light: #ffeaea;
  /* alias for legacy uses in JS/CSS */
  --error: #e16259;
  --info: #2383e2;
  --info-light: #e7f3ff;
  

  --shadow: none;
  --shadow-hover: none;
  --shadow-focus: 0 0 0 2px rgba(35, 131, 226, 0.2);
  

  --radius: 10px;
  --radius-sm: 12px;
  --radius-lg: 28px;
}

*{
  box-sizing: border-box;
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 18px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus management */
*:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Minimal Typography */
h1, .h1 {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 8px 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

h2, .h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

h3, .h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 4px 0;
  color: var(--text);
}

h4, .h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 4px 0;
  color: var(--text);
}

h5, .h5 {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 4px 0;
  color: var(--text);
}

h6, .h6 {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 4px 0;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Text sizes - Notion style */
.text-xs {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-tertiary);
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.text-base {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text);
}

/* Font weights */
.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* Global Checkbox Styles */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  margin: 0;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 48%;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

input[type="checkbox"]:hover {
  border-color: var(--accent);
}

input[type="checkbox"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Text colors - Notion style */
.text-muted {
  color: var(--text-secondary);
}

.text-muted-2 {
  color: var(--text-tertiary);
}

.text-accent {
  color: var(--accent);
}

/* Responsive typography */
@media (max-width: 768px) {
  h1, .h1 {
    font-size: 1.75rem;
  }
  
  h2, .h2 {
    font-size: 1.375rem;
  }
  
  h3, .h3 {
    font-size: 1.125rem;
  }
}

a{
  color:var(--accent);
  text-decoration:none
}

/* Notion-style Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #2c2f33;
  border-bottom: 1px solid #40444b;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar-in{
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}



.logo-img{
  height: 24px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.logo-img:hover{
  opacity: 0.8;
}

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

/* Report status pill next to Exports */
.report-status{ display:flex; align-items:center; gap:8px; margin-left: 8px; }
.report-pill{ display:inline-flex; align-items:center; gap:8px; padding: 0 12px; height:32px; border-radius: 999px; border:1px solid var(--line); background: var(--bg-tertiary); color: var(--text); cursor: default; font-size:14px; }
.report-pill{ transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.report-pill .label, .report-pill .spinner, .report-pill svg{ transition: opacity .15s ease, transform .15s ease; }
.report-pill .spinner{ width:14px; height:14px; border-radius:50%; border:2px solid rgba(0,0,0,.15); border-top-color: currentColor; animation: spin 0.9s linear infinite; }
.report-text{ font-size: 14px; color: var(--text-secondary); }
.report-pill.gen{ background: var(--bg-tertiary); border-color: var(--line); color: var(--text-secondary); }
.report-pill.done{ background: var(--panel); border-color: var(--line); color: var(--text); }
.report-pill.ready{ background: var(--success-light); border-color: var(--success); color: var(--success); cursor: pointer; }
.report-pill svg{ width:14px; height:14px; display:block; }

.tab{
  padding: 0 16px;
  border-radius: 6px;
  color: #b9bbbe;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  height: 32px;
}

.tab:hover{
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.tab.active{
  color: #ffffff;
  font-weight: 600;
}

.tab.active::after{
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.sp{
  flex:1
}


.org-selector{ display:flex; align-items:center; gap:8px; color:#b9bbbe; font-size:14px; font-weight:600; padding:8px 12px; border-radius:6px; cursor:pointer; transition: all .15s ease; }
.org-selector:hover{ background: rgba(255,255,255,0.1); color:#fff; }
.org-selector .org-name{ white-space: nowrap; }
.org-selector .chev{ transition: transform .15s ease; }
.org-selector[aria-expanded="true"] .chev{ transform: rotate(180deg); }

/* Interactive Header */
.interactive-header {
  width: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  --header-font-size: 32px;
  --header-line: 1.2;
}

/* Header left: logo + title */
.header-left{ display:flex; align-items:flex-start; gap: 24px; min-width:0; }
.company-logo{ 
  height: calc(var(--header-font-size) * var(--header-line) * 2);
  width: auto;
  border-radius: 0; 
  border: none; 
  background: transparent; 
  object-fit: contain;
  display: block;
}
.header-left .header-title{ margin: 0; }

.header-title {
  font-size: var(--header-font-size);
  font-weight: 700;
  line-height: var(--header-line);
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
  text-align: left;
  flex: 1 1 auto; /* fill available space */
  min-width: 0;   /* allow shrinking */
}
.header-title .line{ display:block; white-space: normal; word-break: break-word; }

.header-accent {
  color: var(--accent);
  font-weight: 800;
}

.header-exports{ display:flex; align-items:center; gap: 12px; position: relative; z-index: 5; flex: 0 0 auto; }

.header-exports .actions{ flex: 1; }
.header-exports .actions .export-card.placeholder{ position: static; width: 100%; min-height: auto; padding: 8px 12px; border-radius: 8px; }

/* stack sits above title when expanding; hugs content on the right */
.exports-stack{ position: relative; z-index: 6; height: 110px; min-width: 220px; overflow: visible; --step: -10px; flex: 0 0 auto; margin-left: auto; }

/* base transform driven by per-card index (stack pinned to RIGHT, growing to the LEFT) */
.export-card{ transition: transform 0.25s ease, opacity 0.2s ease; transform: translateX(calc(var(--i, 0) * var(--step))); right: 0; }
/* hovered card stays; newer cards (following siblings) unfold to full width left */
.exports-stack .export-card:hover{ transform: translateX(calc(var(--i, 0) * var(--step))); z-index: 1000; }
.exports-stack .export-card:hover ~ .export-card{ transform: translateX(calc(var(--i, 0) * var(--step) - 100% - 10px)); z-index: 900; }

/* Appear animation */
@keyframes cardIn{ from{ opacity:0; } to{ opacity:1; } }
.export-card{ animation: cardIn .25s ease both; }

/* prevent layout shift when expanding: allow overflow to float over title */
.interactive-header{ overflow: visible; }

/* Card base */
.export-card{
  position: absolute;
  top: 0;
  left: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  width: 200px;
  min-height: 84px;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* previous cards slightly deemphasized */
.export-card.old{ opacity: 0.9; }

/* content layout */
.export-card .name{ font-weight: 600; }
.export-card .meta{ font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.export-card .actions{ display:flex; gap:8px; margin-top: 6px; }
.export-card .btn{ padding: 6px 10px; font-size: 12px; }

/* placeholder button keep inline size */


@media (max-width: 768px){
  .interactive-header{ --header-font-size: 24px; }
  .exports-stack{ height: 90px; }
}

.wrap{
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
  position: relative;
  z-index: 10; /* above preset-rail (z=1) */
}

.main-content {
  width: 100%;
}

.left-column{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.right-column{
  width: 352px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Larger top corner rounding for main content block */
.card.content-block{ border-top-left-radius: 40px; border-top-right-radius: 40px; }

.card .hd{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-secondary);
}

.btn{
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  text-decoration: none;
  color: var(--text);
}

.btn:hover{
  background: var(--bg-tertiary);
  border-color: var(--line-strong);
}

.btn:active{ background: var(--bg-tertiary); }

.btn.primary{
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn.primary:hover{
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn.round{
  border-radius: 0.2rem;
}

.btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

/* Loading States (not used) - removed */

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

/* Enhanced Button Styles */
.btn .icon {
  margin-right: 6px;
  font-size: 14px;
}

.btn.secondary {
  background: var(--bg-tertiary);
  border-color: var(--line);
  color: var(--text);
}

.btn.secondary:hover {
  background: var(--line-strong);
  border-color: var(--line-strong);
}

/* Advanced Filters Toggle */
.advanced-filters.hidden {
  display: none;
}

.advanced-filters.visible {
  display: block;
  animation: slideDown 0.3s ease;
}

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

/* Filter Active States */
.filter-active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Enhanced Toast Styles */
/* Toasts removed */

/* Primary Actions Section */
.primary-actions {
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Notion-style Search */
.search-bar{
  padding: 0;
  background: transparent;
  border-bottom: none;
}

.search-bar input{
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
}

.search-bar input:focus{
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
  outline: none;
  background: var(--panel);
}

.search-bar input::placeholder{
  color: var(--text-tertiary);
}

/* Quick Filters */
.quick-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-chip:hover {
  background: var(--bg-tertiary);
  border-color: var(--line-strong);
}

.filter-chip.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.status-dot {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.status-dot.succeeded {
  color: var(--success);
}

.status-dot.pending {
  color: var(--warning);
}

.status-dot.failed {
  color: var(--danger);
}

.count {
  color: var(--text-secondary);
  font-size: 12px;
}

.clear-filters {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.clear-filters:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

/* Notion-style Advanced Filters */
.advanced-filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin: 0 20px 20px;
  padding: 20px;
  transition: all 0.3s ease;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Date Filter */
.date-filter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 300px;
}

.date-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  align-self: flex-start;
}

.date-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}

.date-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.date-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.date-preset {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.date-preset:hover {
  background: var(--bg-tertiary);
  color: var(--text);
  border-color: var(--line-strong);
}

.date-preset.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.date-display {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Dropdown Filters */
.dropdown-filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-dropdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.filter-dropdown label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.filter-dropdown select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  font-family: inherit;
}

.filter-dropdown select:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* Checkbox Filters */
.checkbox-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.checkbox-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.checkbox-item input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  vertical-align: middle;
}

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

.generate-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(35, 131, 226, 0.3);
}

.generate-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(35, 131, 226, 0.4);
}

.generate-btn:active {
  transform: translateY(0);
}

.icon {
  font-size: 1rem;
}

.kpis{
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(6, 1fr);
  padding: 24px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.kpi{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.kpi .lbl{
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi .val{
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  line-height: 1.2;
}

.filters{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--line);
}

.chip{
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  background: var(--panel);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
}

.chip:hover{
  background: var(--bg-tertiary);
  border-color: var(--accent);
  color: var(--accent);
}

.chip.active{
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

/* Notion-style Table */
.table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background: var(--panel);
  border-radius: var(--radius-lg);
  overflow: visible;
}

.table th{
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* --- Table refinements for compact multi-line cells and row hover rounding --- */
/* remove vertical cell borders – keep only top/bottom per row */
.table td{
  padding: 8px 16px;
  border-bottom: none;
  border-radius: 0;
  border-left: none;
  border-right: none;
  background: var(--panel);
  vertical-align: top;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  font-size: 14px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--text);
}
/* keep only header bottom divider */
.table thead th{ border-bottom: 1px solid var(--line); }
/* row hover background as rounded rectangle by rounding first/last cell corners */
.table tbody tr:hover td{ background: var(--bg-tertiary); }
.table tbody tr:hover td:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
  overflow: hidden;
}
.table tbody tr:hover td:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  overflow: hidden;
}
/* Donation ID: match mono/muted style without special chip */
.table td .mono{ 
  color: var(--text); 
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 14px;
}
.table td .mono.copy{ position: relative; cursor: pointer; transition: color .15s ease; display: inline-block; z-index: 0; }
.table td .mono.copy:hover{ color: var(--text); }
.table td .mono.copy::before{
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% + 12px);
  height: 1.75em;
  background: var(--text-quaternary);
  border-radius: 6px;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: -1;
  pointer-events: none;
}
.table td .mono.copy:hover::before{ opacity: 1; }
.table td .mono.copy.copied::after{
  content: 'copied';
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--text-secondary);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  padding: 2px 6px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.table td .mono.muted{ color: var(--muted); }

/* Status column: right align */
.table td:last-child{ text-align: right; }
.table th:last-child{ text-align: right; }

/* Badge with inline svg icon */
.badge{ display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius: 999px; font-size:12px; border:1px solid var(--line); background: var(--panel); color: var(--text); }
.badge svg{ width:12px; height:12px; display:block; }
.badge .label{ line-height: 1; }
.badge.succeeded{ color: #0a7a2a; border-color: var(--line); background:#f6ffed; height:24px; }
.badge.failed{ color: #a8071a; border-color: var(--line); background:#fff1f0; height:24px; }
.badge.pending{ color: #874d00; border-color: var(--line); background:#fff7e6; height:24px; }
.badge.refunded{ color: #006d75; border-color: var(--line); background:#e6fffb; height:24px; }
.badge.disputed{ color: #613400; border-color: var(--line); background:#fff7e6; height:24px; }

.table tbody tr{
  cursor: pointer;
  transition: background-color 0.15s ease;
}


/* Remove blue focus effect on click */
.table tbody tr:focus,
.table tbody tr:focus-visible{
  outline: none;
  box-shadow: none;
}
.table tbody tr:focus-within td{ background: transparent; }
.table tbody tr:focus-within:hover td{ background: var(--bg-tertiary); }

.table tbody tr:first-child td:first-child{ border-top-left-radius: var(--radius); }
.table tbody tr:first-child td:last-child{ border-top-right-radius: var(--radius); }
.table tbody tr:last-child td:first-child{ border-bottom-left-radius: var(--radius); }
.table tbody tr:last-child td:last-child{ border-bottom-right-radius: var(--radius); }

/* day grouping border */
.table tr.day-end-row td{ border-bottom: 1px solid var(--line-strong); }

.row-actions{
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.kebab{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f6f8fb;
}

.muted{
  color: var(--muted);
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.copy{
  cursor: pointer;
  position: relative;
  display: inline-block;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.copy::before{
  content: '';
  position: absolute;
  top: -4px;
  left: -8px;
  right: -8px;
  bottom: -4px;
  background: var(--text-secondary);
  border-radius: var(--radius-sm);
  opacity: 0;
  transform: scale(0.95);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  z-index: -1;
}

.copy:hover::before{
  opacity: 1;
  transform: scale(1);
}

.copy:hover{
  color: var(--panel);
}


.badge{
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid transparent;
}

.SUC{
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success-light);
}

.PEN{
  background: var(--warning-light);
  color: var(--warning);
  border-color: var(--warning-light);
}

.FAI{
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger-light);
}

.REF{
  background: var(--info-light);
  color: var(--info);
  border-color: var(--info-light);
}

.DIS{
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border-color: var(--line);
}

/* Sidebar controls */
.controls{
  display: grid;
  gap: 12px;
  padding: 16px;
}

.toggle{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.checklist{
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 16px;
}

/* Pagination row: left range, center pager, right per-page */
.pagination-row{ display:flex; align-items:center; justify-content: space-between; padding: 12px 0 0; gap: 12px; font-size: 14px; }
.pagination-row .range-left{ color: var(--text-secondary); font-size: 14px; }
.pagination-row .pager-center{ display:flex; align-items:center; gap:6px; justify-content:center; flex:1; }
.pagination-row .per-right{ display:flex; align-items:center; gap:8px; margin-left:auto; }
.pagination-row .per-right{ font-size: 14px; }
.pagination-row .per-right select{ font-size: 14px; }

.pagination{ display:flex; gap:6px; align-items:center; justify-content:center; background: transparent; font-size: 14px; }
.pagination .pg{ padding: 0 10px; height: 32px; min-width: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; text-align:center; cursor:pointer; color: var(--text); font-size: 14px; display:inline-flex; align-items:center; justify-content:center; }
.pagination .pg svg{ width:16px; height:16px; display:block; }
.pagination .pg.active{ border-color: var(--line-strong); background: transparent; }
.pagination .pg:hover{ background: var(--bg-tertiary); }

/* View controls under pagination */
.view-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.view-controls .toggle {
  font-size: 14px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-controls .toggle.text-sm {
  font-size: 14px !important;
}

.view-controls .pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-controls .pagination-controls label {
  font-size: 14px;
  font-weight: 500;
}

.view-controls select {
  font-size: 14px;
}

/* Column controls under view controls */
.column-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.column-controls label {
  font-size: 14px;
  font-weight: 500;
}

.checklist label {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Groups */
.group{
  margin-bottom: 14px;
}

.group-hd{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f9fbff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.group-hd .meta{
  display: flex;
  gap: 12px;
  color: var(--muted);
}

.collapse{
  cursor: pointer;
}

/* Popover */
.popover{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  z-index: 1000;
}

.popover.show{ display:flex; }

.popover.positioned{ align-items: flex-end; justify-content: flex-end; }

.popover-content{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(2,8,23,0.28);
  width: 560px;
  max-width: 96vw;
  max-height: none; /* no scroll inside */
  overflow: hidden;
  position: static;
  transform: translateY(24px);
  opacity: 0;
  animation: popoverSlideUp .2s ease forwards;
}

.popover.positioned .popover-content{ position: static; }

.popover-header{
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between; /* title and status in one row */
  background: var(--bg-secondary);
}

.popover-close{ border:1px solid var(--line); background: var(--panel); height:32px; padding:0 12px; border-radius: var(--radius); font-size:14px; display:inline-flex; align-items:center; justify-content:center; color: var(--text); }

.popover-close:hover{ background: var(--bg-tertiary); border-color: var(--line-strong); }

.popover-body{
  padding: 16px 20px 20px;
  max-height: none;
  overflow: visible;
}

/* Compact Popover Layout */
.donation-details-compact{
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.detail-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.detail-main{
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-amount{
  font-size: 24px;
  font-weight: 700;
  color: var(--success);
}

.detail-status{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-id{
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.detail-content{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

.detail-column{
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.detail-group{
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 80px;
}

.detail-group-title{
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 13px;
  min-height: 20px;
}

.detail-label{
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 60px;
  flex-shrink: 0;
}

.detail-value{
  color: var(--text);
  font-weight: 500;
  text-align: left;
  flex: 1;
  margin-left: 8px;
}

.detail-value.mono{ font-family: inherit !important; font-size: 14px; }

.detail-value.amount{
  color: var(--success);
  font-weight: 600;
}

/* Popover Content Layout */
.donation-details{
  display: grid;
  gap: 24px;
}

.detail-section{
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.detail-section h4{
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section h4 .icon{
  font-size: 18px;
  opacity: 0.7;
}

.detail-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
  }
  
.detail-item{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label{
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value{
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.detail-value.mono{ font-family: inherit !important; background: transparent; padding: 0; border: none; }

.detail-value.amount{
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}

.detail-value.status{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.detail-value.status.succeeded{
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}

.detail-value.status.pending{
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.detail-value.status.failed{
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.detail-value.status.refunded{
  background: var(--info-light);
  color: var(--info);
  border: 1px solid var(--info);
}

.detail-value.status.disputed{
  background: var(--text-quaternary);
  color: var(--text-secondary);
  border: 1px solid var(--line-strong);
}

.status-dot{
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

.payment-info{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.payment-icon{
  width: 32px;
  height: 32px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--accent);
}

.payment-details{
  flex: 1;
}

.payment-brand{
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.payment-meta{
  font-size: 12px;
  color: var(--text-secondary);
}

.timeline{
  position: relative;
  padding-left: 20px;
}

.timeline::before{
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
    background: var(--line);
}

.timeline-item{
  position: relative;
  margin-bottom: 16px;
  padding-left: 16px;
}

.timeline-item::before{
  content: '';
  position: absolute;
  left: -12px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
    background: var(--accent);
  border: 2px solid var(--panel);
}

.timeline-time{
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.timeline-desc{
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popoverAppear {
  from { 
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popoverSlideUp{
  from{ opacity:0; transform: translateY(50vh); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes popoverSlideDown{
  from{ opacity:1; transform: translateY(0); }
  to{ opacity:0; transform: translateY(50vh); }
}

@keyframes popoverDisappear {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

/* removed unused .drawer styles */

/* legacy grid rules removed — using flex on .wrap */

.export-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.controls-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}


.view-controls .toggle {
  display: block;
  margin-bottom: 8px;
}

.pagination-controls {
  margin-top: 12px;
}

.pagination-controls label {
  display: block;
  margin-bottom: 4px;
}

.pagination-controls select {
  width: 100%;
    padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 12px;
}

.column-controls {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* PAGE TITLE */



/* TOP BLOCK: Search and Filters */
.top-block {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;

}

.search-section { margin-bottom: 0; }
.status-filters { margin-bottom: 0; }
.status-filters .filter-group{ display:flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-filters .status-actions-right{ display:flex; gap: 8px; margin-left: auto; }
.date-filters { margin-bottom: 0; }
.date-filters .filter-group{ display:flex; align-items:flex-start; justify-content: space-between; gap: 12px; }
.date-filters .date-controls{ flex: 1; }
.date-filters #togglePresetsBtn{ flex: 0 0 auto; margin-left: auto; }
.btn.muted{ background: transparent; color: var(--text-secondary); border:1px solid transparent; }
.btn.muted:hover{ background: var(--bg-tertiary); }
.btn.muted.active{ border-color: var(--line-strong); color: var(--text); }
.date-presets { margin-bottom: 0; }

.search-bar {
  position: relative;
  max-width: 600px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  background: var(--panel);
  transition: all 0.15s ease;
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.1);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  font-size: 16px;
}

.filter-group {
  display: flex;
    flex-direction: row;
    gap: 12px;
  }

.filter-group-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.status-checkboxes {
  display: flex;
    gap: 8px;
  flex-wrap: wrap;
}

.status-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  height: 32px;
}

.status-checkbox-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--line-strong);
}

.status-checkbox-item input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.status-checkbox-item input[type="checkbox"]:checked {
  accent-color: var(--accent);
}

.status-checkbox-item input[type="checkbox"]:checked + .status-dot {
  opacity: 1;
}

.status-checkbox-item input[type="checkbox"]:not(:checked) + .status-dot {
  opacity: 0.5;
}

.status-checkbox-item.active {
  background: var(--accent);
  color: var(--panel);
  border-color: var(--accent);
}

.status-checkbox-item.active .status-dot {
  color: var(--panel);
}

/* Remove count styling (not used) */
.count { display: none; }

/* Row 3: Quick report + Displayed period + Advanced report */
.filters-row-3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  justify-content: space-between;
}

.filters-row-3 .btn {
  flex-shrink: 0;
  height: 32px;
}

.filters-row-3 .date-display { 
  flex: 0 0 auto; 
  margin: 0; 
  height: 32px; 
  display: flex; 
  align-items: center; 
}
.filters-row-3 #advancedExportBtn{ margin-left: auto; }

  .date-presets {
  display: flex;
  gap: 8px;
    flex-wrap: wrap;
  margin-bottom: 0;
}

.date-preset {
  padding: 0 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 32px;
  display: inline-flex; align-items:center; justify-content:center;
}

.date-preset:hover {
  background: var(--bg-tertiary);
  border-color: var(--line-strong);
}

.date-preset.active {
  background: var(--accent);
  color: var(--panel);
  border-color: var(--accent);
}

.date-display {
  padding: 0 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  height: 32px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.date-range-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Results & insights styles consolidated above */

.table-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
    flex-direction: column;
}

/* Inline insights row placed above table */
.insights-inline{
  display: grid;
  grid-template-columns: 1fr;
    gap: 12px;
  margin-bottom: 16px;
}
.insights-inline #kpis{ display: none; }
.insights-inline #insightsContent{
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 8px;
}

@media (max-width: 1024px){
  .insights-inline #insightsContent{grid-template-columns: repeat(2, minmax(0,1fr));}
}
@media (max-width: 640px){
  .insights-inline #insightsContent{grid-template-columns: 1fr;}
}

/* Modal styles */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(30, 41, 59, 0);
  display: none;
  align-items: center;
    justify-content: center;
  z-index: 30;
  transition: background-color .2s ease;
}

.modal.show { display: flex; }
.modal.visible { background-color: rgba(30, 41, 59, 0.25); }

.modal.show .panel{ animation: popoverSlideUp .2s ease both; }
.modal.show.hiding .panel{ animation: popoverSlideDown .2s ease both; }

.panel {
  width: min(1024px, 96vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(2,8,23,0.28);
  overflow: hidden;
}

.panel .hd {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
}

.panel .bd {
  padding: 24px;
  display: grid;
  gap: 16px;
}
.panel .bd .ex-sep{ border: none; border-top: 1px solid var(--line); margin: 8px 0; }

/* Modal header close button match popover style */
.panel .hd #exClose{ border:1px solid var(--line); background: var(--panel); height:32px; padding:0 12px; border-radius: var(--radius); font-size:14px; display:inline-flex; align-items:center; justify-content:center; color: var(--text); }
.panel .hd #exClose:hover{ background: var(--bg-tertiary); border-color: var(--line-strong); }

/* Table-like section headers inside modal */
.table-header{ text-transform: uppercase; font-size: 12px; color: var(--muted); letter-spacing: .5px; font-weight: 600; }

/* file type radio row */
.type-row{ display:flex; gap:16px; }
.type-row .radio{ display:flex; align-items:center; gap:6px; font-size:14px; }
.type-row input[type="radio"]{ width:16px; height:16px; accent-color: var(--accent); }

/* export footer */
.export-actions{ display:flex; align-items:center; justify-content: space-between; gap: 12px; }
.export-actions .export-left{ display:flex; align-items:center; gap:16px; }
.export-actions .export-right{ display:flex; align-items:center; gap:12px; }

/* Modal field layout & controls, aligned with main design */
.panel .bd .fld{ display:flex; flex-direction:column; gap:6px; }
.panel .bd label{ font-size: 14px; color: var(--text-secondary); }
.panel .bd input[type="date"],
.panel .bd input[type="text"],
.panel .bd input[type="search"],
.panel .bd select{
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}
.panel .bd input[type="date"]:focus,
.panel .bd input[type="text"]:focus,
.panel .bd input[type="search"]:focus,
.panel .bd select:focus{
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

/* Two-column helper inside modal */
.panel .bd .grid-2{ display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
@media (max-width: 768px){
  .panel .bd .grid-2{ grid-template-columns: 1fr; }
}

/* Export modal field selection */
.field-selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.field-selection-title strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.field-selection-actions {
  display: flex;
  gap: 8px;
}

.field-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.field-column {
  display: flex;
    flex-direction: column;
}

.field-column-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
}

.field-column-list {
  display: flex;
    flex-direction: column;
  gap: 4px;
}

.field-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.field-item input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

@media (max-width: 1024px) {
  .field-columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .field-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* spacing between header (create report) and export cards */
.insights-section .hd{margin-bottom:12px}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}


.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-controls {
  display: flex;
  flex-direction: column;
  text-align: left;
    align-items: flex-start;
    gap: 8px;
  }

.insights-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
    flex-direction: column;
}

.insights-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.insights-header h3 {
  margin: 0 0 4px 0;
}

.insights-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insight-card {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insight-icon {
  font-size: 16px;
}

.insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
    margin: 0;
  }

.insight-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text); /* default text color instead of accent */
  margin: 0;
  line-height: 1.2;
}

.insight-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.insights-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* BOTTOM BLOCK: Exports */
.bottom-block {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.exports-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.current-exports {
  display: flex;
  flex-direction: column;
    gap: 12px;
  }

.recent-exports {
  display: flex;
  flex-direction: column;
    gap: 12px;
  }

.export-item {
  display: flex;
    flex-direction: column;
    align-items: flex-start;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.15s ease;
    gap: 8px;
  }

.export-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.export-item.processing {
  border-color: var(--warning);
  background: var(--warning-light);
}

.export-item.completed {
  border-color: var(--success);
  background: var(--success-light);
}

.export-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.export-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.export-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.export-date {
  font-weight: 500;
}

.export-rows {
  font-weight: 500;
}

.export-size {
  font-weight: 500;
}

.export-actions { display: flex; gap: 8px; margin-top: 6px; }

/* Loading state for buttons (used in Export history while generating) */
.btn.loading{
  position: relative;
  pointer-events: none;
  color: var(--text-secondary);
}
.btn.loading::before{
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

.export-progress {
  width: 200px;
}

.progress-bar {
    width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--warning);
  border-radius: 2px;
  transition: width 0.3s ease;
}

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

/* Pie Chart Styles */
.pie-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(
    var(--success) 0deg 180deg,
    var(--warning) 180deg 240deg,
    var(--error) 240deg 270deg,
    var(--info) 270deg 300deg,
    var(--text-secondary) 300deg 360deg
  );
  position: relative;
  margin: 0 auto;
}

.pie-chart::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  background: var(--panel);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pie-chart-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* main-content removed; responsive handled by .wrap flex */

@media (max-width: 768px) {
  .wrap {
    padding: 16px;
    gap: 16px;
  }

  .main-content {
    flex-direction: column;
  }
  
  .header-title {
    font-size: 24px;
  }
  .interactive-header{ flex-direction: column; align-items: flex-start; gap: 12px; }
  .header-exports{ width: 100%; justify-content: space-between; }
  .exports-stack{ display: none; }
  .company-logo{ height: 40px; }
  
  .table-controls {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .view-controls {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .column-controls {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .status-checkboxes {
    flex-direction: column;
    gap: 8px;
  }
  
  .status-checkbox-item {
    justify-content: flex-start;
  }
  
  .date-presets {
    flex-direction: column;
    gap: 8px;
  }

  /* Table: horizontal scroll on small screens */
  .table-col{ overflow-x: auto; }
  .table{ min-width: 720px; }
}

@media (max-width: 640px){
  /* Hide less-important columns on very small screens */
  .table th.col-time, .table td.col-time{ display: none; }
  .table th.col-tribute, .table td.col-tribute{ display: none; }
  /* condense supporter subline */
  .table td.col-supporter .muted{ display:inline; margin-left: 6px; }
  .filters-block{ gap: 12px; }
  .filters-block .filters-row-3{ flex-direction: column; align-items: flex-start; gap: 8px; }
  .filters-block .generate-actions{ margin-left: 0 !important; }
  /* modal & popover widths */
  .panel{ width: 96vw; }
  .popover-content{ width: 96vw; }
}

.right-column .view-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.right-column .view-controls .toggle{ display:flex; align-items:center; gap:8px; }
.right-column .pagination-controls{ display:flex; align-items:center; gap:8px; }
.right-column .pagination-controls label{ font-size: 13px; }
.right-column .pagination-controls select{ width:auto; min-width:120px; }
.right-column .column-controls{ margin-top: 16px; }

/* ===== Two-column grid hardening ===== */
.wrap{ align-items: start; }
.left-column, .right-column{ min-width: 0; }
.left-column{ overflow: visible; }
.right-column{ width: 352px; overflow: visible; }
.insights-inline{ max-width: 100%; }

/* variable alias used elsewhere */
:root{ --text-primary: var(--text); }

/* Content block layout */
.content-block{ padding: 16px; z-index: 100; }

/* Unified filters block */
.filters-block{
  display: grid;
  gap: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.content-body{ display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: start; }
.table-col{ min-width: 0; width: 100%; }
.table{ width: 100%; }
.insights-col{ display: grid; gap: 14px; }

/* Insight cards spacing & radius */
.insight-card { border-radius: 16px; padding: 20px; }

@media (max-width: 1024px){
  .content-body{ grid-template-columns: 1fr; }
}

.table-toolbar{ display:flex; align-items:center; gap: 12px; padding: 8px 0 12px 0; font-size: 14px; }
.table-toolbar .search-group{ display:flex; align-items:center; gap: 8px; width: 50%; min-width: 280px; }
.table-toolbar .search-group .search-bar{ flex: 1; max-width: none; }
.table-toolbar .range-info{ color: var(--text-secondary); font-size: 14px; }
.table-toolbar .tb-spacer{ flex: 1; }
.table-toolbar .per-page{ display:none; }
.table-toolbar .sort-controls{ display:flex; align-items:center; gap: 10px; font-size: 14px; color: var(--text-secondary); }
.table-toolbar .sort-controls .radio{ display:inline-flex; align-items:center; gap:6px; cursor:pointer; color: var(--text); }
.table-toolbar .sort-controls input[type="radio"]{ width:16px; height:16px; accent-color: var(--accent); }
.table-toolbar select{ font-size: 14px; }
.table-toolbar input[type="search"]{ font-size: 14px; }

/* Stabilize table layout: equal column widths, no jump */
.table{ table-layout: auto; }
/* remove global equal widths in favor of per-column sizing */
/* .table thead th, .table tbody td{ width: calc(100% / var(--cols, 8)); } */
/* default wrapping so content isn't hidden */
.table td{ white-space: normal; overflow: visible; text-overflow: clip; }

/* Fixed widths for Date/Time/Status/Amount/ID and flexible for others */
/* .table th.col-date, .table td.col-date{ width: 9ch; } */
/* .table th.col-time, .table td.col-time{ width: 9ch; } */
/* .table th.col-amount, .table td.col-amount{ width: 10ch; text-align: right; } */
/* .table th.col-status, .table td.col-status{ width: 12ch; } */
/* .table th.col-id, .table td.col-id{ width: 14ch; } */
/* .table th.col-supporter, .table td.col-supporter{ width: 28%; } */
/* .table th.col-location, .table td.col-location{ width: 22%; } */
/* .table th.col-tribute, .table td.col-tribute{ width: 16%; } */

/* Allow wrapping so nothing is hidden */
.table td{ white-space: normal; overflow: visible; text-overflow: clip; }

/* Keep Status right-aligned only */
.table th.col-status, .table td.col-status{ text-align: right; }

/* Right align numeric/status */
.table th.col-time, .table td.col-time,
.table th.col-amount, .table td.col-amount,
.table th.col-status, .table td.col-status{ text-align: right; }

/* Emphasize amount values in table */
/* Reset default weight; bold only for main amount line */
.table td.col-amount{ font-weight: 400; }
.table td.col-amount > div:first-child{ font-weight: 700; }
.table td.col-amount .muted{ font-weight: 400; }

/* Remove grid-based rows */
/* .table thead tr, .table tbody tr{ display: grid; grid-template-columns: 9ch 9ch 10ch 14ch 1fr 1fr 1fr 12ch; align-items: start; } */
/* .table thead th, .table tbody td{ border-bottom: 1px solid transparent; } */
/* No wrap on fixed columns (not used now) */
/* .table td.col-date, .table td.col-time, .table td.col-amount, .table td.col-id{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } */

/* Consistent inset separators (same color as row hover) */
/* .table thead tr, .table tbody tr{ position: relative; } */
/* .table thead tr::after, .table tbody tr::after{
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: var(--bg-tertiary);
  pointer-events: none;
  z-index: 1;
} */
/* Remove native bottom borders to avoid double lines */
.table thead th{ border-bottom: none; }
/* Day separator uses the same line now */
.table tr.day-end-row td{ border-bottom: none; }

/* Restore native header and day-end borders with hover-color */
.table thead th{ border-bottom: 1px solid var(--bg-tertiary) !important; }
.table tr.day-end-row td{ border-bottom: 1px solid var(--bg-tertiary) !important; }

/* Make main-content fill available width */
.main-content { width: 100%; flex: 1 1 auto; align-self: stretch; }

.filter-presets{ display:flex; gap:8px; flex-wrap: wrap; }
.btn-mini{ padding: 6px 10px; border:1px solid transparent; background: transparent; border-radius: 999px; font-size: 12px; cursor: pointer; color: var(--text-secondary); }
.btn-mini.active{ background: var(--accent); color: var(--panel); border-color: var(--accent); }
.btn-mini:hover{ color: var(--text); }

/* Preset vertical rail outside main-content */
.wrap{ position: relative; }
.main-content{ position: relative; }
.preset-rail{
  position: absolute; /* outside wrap, scrolls with page */
  left: 0; top: 0; /* will be set via JS */
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start; /* left align */
  text-align: left;
  opacity: 0; /* hidden by default */
  pointer-events: none;
  transform: translateX(-200px); /* slide from under wrap on the left (~200px) */
  /* base (hidden) state: use ease-in for hiding */
  transition: opacity .25s ease-in, transform .25s ease-in;
  z-index: 1; /* low, but interactive for hover */
}

/* Footer logo: force light gray */
footer [data-logo="true"], .footer [data-logo="true"]{ color: var(--text-quaternary); }
footer [data-logo="true"] *, .footer [data-logo="true"] *{ fill: var(--text-quaternary) !important; }

/* Footer layout */
.site-footer{ padding: 24px 0 80px; display:flex; align-items:center; justify-content:center; }
.site-footer .footer-inner{ display:flex; align-items:center; justify-content:center; }
 .preset-rail.show{ opacity:.35; transform: translateX(-10px); pointer-events: auto; transition: opacity .25s ease-out, transform .25s ease-out; }
 .preset-rail.show.delay-fade:not(:hover):not(:focus-within){ transition: opacity .25s ease-in 1s, transform .25s ease-in; }
.preset-rail.show:hover,
.preset-rail.show:focus-within{ opacity: 1; transition: opacity .15s ease, transform .25s ease; }
.preset-rail .btn-mini{ padding: 6px 10px; border:1px solid transparent; background: transparent; color: var(--text-secondary); border-radius: 999px; display:block; text-align:left; white-space: nowrap; cursor:pointer; }
.preset-rail .btn-mini:hover,
.preset-rail .btn-mini:focus{ background: var(--bg-tertiary); color: var(--text); }
.preset-rail .btn-mini.active{ border-color: var(--line-strong); color: var(--text); background: transparent; }
.preset-rail .btn-mini.active:hover,
.preset-rail .btn-mini.active:focus{ background: var(--bg-tertiary); }
