:root{
  --bg: #f6f8ff;
  --card: #ffffff;
  --border: #e8ecf7;
  --text: #0f172a;
  --muted: #5b677a;
  --muted2: #7b8798;
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.10);
  --shadow2: 0 10px 30px rgba(15, 23, 42, 0.08);
  --accent: #2563eb;
  --accent2: #1d4ed8;
}

*{ box-sizing: border-box; }

body{
  font-family: "Poppins", sans-serif;
  background: radial-gradient(900px 500px at 15% 10%, rgba(37,99,235,0.10), transparent 55%),
              radial-gradient(900px 500px at 85% 25%, rgba(99,102,241,0.10), transparent 55%),
              var(--bg);
  color: var(--text);
}

/* ✅ IMPORTANT: avoid overlap with sticky header */
.reports-page{
  padding: 120px 0 55px; /* increase top padding to avoid header overlap */
}

.reports-container{
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
}

.reports-hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 14px;
  padding: 18px 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
}

.reports-title{
  margin:0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.reports-sub{
  margin:6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.reports-search{
  display:flex;
  align-items:center;
  gap: 10px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  min-width: 320px;
  box-shadow: var(--shadow2);
}

.search-ico{ opacity: .7; }

.reports-search input{
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.reports-search input::placeholder{
  color: var(--muted2);
}

.reports-grid{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
}

.reports-list-card,
.reports-view-card{
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.list-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fafbff);
}

.list-title{
  font-weight: 800;
  font-size: 13px;
}

.list-badge{
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f3f6ff;
  color: var(--text);
  font-weight: 700;
}

.reports-list{
  max-height: 70vh;
  overflow: auto;
  padding: 10px;
}

.report-item{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  text-decoration:none;
  color: var(--text);
  transition: 0.18s ease;
  margin-bottom: 10px;
}

.report-item:hover{
  transform: translateY(-1px);
  border-color: rgba(37,99,235,0.35);
  box-shadow: var(--shadow2);
}

.report-item.active{
  border-color: rgba(37,99,235,0.55);
  background: rgba(37,99,235,0.06);
}

.file-ico{
  width: 38px;
  height: 38px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 12px;
  background: #f3f6ff;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.file-meta{ min-width: 0; }

.file-name{
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-sub{
  display:flex;
  align-items:center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pill{
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8faff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pill.public{
  border-color: rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.10);
  color: #0f7a3a;
}

.dot{ opacity: .6; }

.view-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fafbff);
}

.view-label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}

.view-file{
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.view-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration:none;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  background: #fff;
  transition: 0.18s ease;
  box-shadow: var(--shadow2);
}

.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(37,99,235,0.30);
}

.btn.primary{
  background: linear-gradient(180deg, rgba(37,99,235,0.98), rgba(29,78,216,0.98));
  border-color: rgba(37,99,235,0.45);
  color: #fff;
  box-shadow: 0 14px 35px rgba(37,99,235,0.22);
}

.btn.outline{
  background: #fff;
  border-color: rgba(37,99,235,0.25);
}

.view-body{
  height: 72vh;
  background: #fff;
}

.reports-iframe{
  width: 100%;
  height: 100%;
  border: 0;
  display:block;
  background: #fff;
}

/* Empty states */
.reports-empty{
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.empty-box{
  text-align:center;
  max-width: 520px;
  margin: 0 auto;
}

.empty-icon{ font-size: 32px; margin-bottom: 10px; }
.empty-title{ font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.empty-sub{ color: var(--muted); font-size: 13px; }

.viewer-empty{
  height: 72vh;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap: 10px;
  color: var(--muted);
  text-align:center;
  padding: 20px;
}

.viewer-empty-icon{ font-size: 28px; opacity: .9; }
.viewer-empty-title{ font-weight: 800; color: var(--text); }
.viewer-empty-sub{ font-size: 13px; }

/* ===== Public Reports – Mobile Fix ===== */
@media (max-width: 768px) {

  /* main wrapper should not overflow */
  .reports-page,
  .reports-wrap,
  .reports-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* stack layout instead of 2 columns */
  .reports-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* preview header: stack title + actions properly */
  .reports-preview-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* actions row */
  .reports-actions {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }

  .reports-actions a,
  .reports-actions button {
    width: 100% !important;   /* full width buttons */
    text-align: center !important;
  }

  /* iframe container height for mobile */
  .reports-preview-body {
    height: 60vh !important;
    min-height: 380px !important;
  }

  .reports-preview-body iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
  }
}

