/* Smart EPD Library â Styles */
.sepd *, .sepd *::before, .sepd *::after { box-sizing: border-box; margin: 0; padding: 0; }
.sepd {
  font-family: 'Muli', -apple-system, BlinkMacSystemFont, 'Arial', Roboto, sans-serif;
  color: #1e293b; max-width: 1280px; margin: 0 auto; padding: 24px 16px;
}
.sepd-search-wrap { background: #f1f5f9; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.sepd-search-box { position: relative; margin-bottom: 16px; }
.sepd-search-box svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; stroke: #94a3b8; fill: none; stroke-width: 2;
  pointer-events: none;
}
.sepd-search-input {
  width: 100% !important; display: block !important; padding: 12px 16px 12px 42px !important; border: 1px solid #d4dce8;
  border-radius: 8px; font-size: 15px; outline: none; transition: border-color .2s; background: #fff;
}
.sepd-search-input:focus { border-color: #41b87f; }
.sepd-search-input::placeholder { color: #94a3b8; }
.sepd-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sepd-fg { position: relative; flex: 1 1 calc(50% - 60px); min-width: 140px; }
.sepd-fg-dd { flex: 1 1 calc(33.33% - 8px); min-width: 180px; position: relative; width:100% }
.sepd-sel {
  width: 100%; padding: 10px 32px 10px 12px; border: 1px solid #d4dce8; border-radius: 8px;
  font-size: 14px; background: #fff; appearance: none; cursor: pointer; color: #64748b; outline: none;
}
.sepd-sel:focus { border-color: #41b87f; }
.sepd-fg-dd::after {
  content: ''; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-top-color: #94a3b8; pointer-events: none;
}

/* ââ Date Picker Dropdown âââââââââââââââââââââââââââ */
.sepd-date-dd { position: relative; width: 100% }
.sepd-date-dd::after { display: none; } /* hide default caret for date dropdowns */
.sepd-date-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: .5em 1em; border: 1px solid #d4dce8; border-radius: 8px;
  font-size: 14px; background: #fff; cursor: pointer; color: #64748b;
  font-family: inherit; outline: none; transition: border-color .2s;
}
.sepd-date-btn:hover, .sepd-date-btn:focus { border-color: #41b87f; }
.sepd-date-btn.has-val {
  color: #1e293b; border-color: #41b87f; background: #f0fdf4;
}
.sepd-date-icon { flex-shrink: 0; stroke: #94a3b8; }
.sepd-date-btn.has-val .sepd-date-icon { stroke: #41b87f; }
.sepd-date-txt {
  flex: 1; text-align: left; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sepd-date-x {
  display: none; font-size: 18px; line-height: 1; color: #94a3b8;
  margin-left: auto; padding: 0 2px; cursor: pointer;
}
.sepd-date-x:hover { color: #ef4444; }
.sepd-date-btn.has-val .sepd-date-x { display: inline; }

.sepd-date-panel {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  width: 280px; max-height: 340px; overflow-y: auto;
  background: #fff; border: 1px solid #64748b; border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0,0,0,.12); z-index: 100; padding: 8px;
}
.sepd-date-panel.open { display: block; }

.sepd-date-yr { margin-bottom: 2px; }
.sepd-date-yr-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: pointer; border-radius: 6px;
  font-weight: 600; font-size: 14px; color: #1e293b; transition: background .15s;
}
.sepd-date-yr-head:hover { background: #f1f5f9; }
.sepd-date-chev { transition: transform .2s; }
.sepd-date-yr-head.open .sepd-date-chev { transform: rotate(180deg); }

.sepd-date-months {
  display: none; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px 4px 8px;
}
.sepd-date-months.open { display: grid; }

.sepd-date-full {
  grid-column: 1 / -1; padding: 8px;
  border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc;
  font-size: 13px; font-weight: 500; color: #475569;
  cursor: pointer; transition: all .15s; font-family: inherit; margin-bottom: 2px;
}
.sepd-date-full:hover { background: #41b87f; color: #fff; border-color: #41b87f; }

.sepd-date-mo {
  padding: 7px 4px; border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff; font-size: 13px; color: #475569;
  cursor: pointer; transition: all .15s; font-family: inherit; text-align: center;
}
.sepd-date-mo:hover { background: #41b87f; color: #fff; border-color: #41b87f; }
/* ââ End Date Picker ââââââââââââââââââââââââââââââââ */

.sepd-af { font-size: 13px; color: #64748b; white-space: nowrap; flex-shrink: 0; }
.sepd-clr {
  background: none; border: none; color: #41b87f; cursor: pointer;
  font-size: 13px; text-decoration: underline; margin-left: 6px;
}
.sepd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 500px)); /* 400–500px cards */
  gap: 20px;
  margin-bottom: 32px;
  padding: 24px;
  justify-content: center; /* centers fixed/max-width columns nicely */
}

.sepd-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  min-width: 0;
  width: 100%;       /* fill the grid track */
  max-width: 500px;  /* hard cap */
}

.sepd-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.sepd-cb {
  display: flex;
  padding: 20px;
  gap: 16px;
  min-width: 0;
}

.sepd-ct {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sepd-cr {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.sepd-cn {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: #1e293b;
  margin-bottom: auto;

  /* 2-line truncation */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  /* modern spec fallback support */
  line-clamp: 2;
}

.sepd-co {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.sepd-cl {
  width: 80px;
  height: 36px;
  object-fit: contain;
}

.sepd-on {
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

.sepd-ci {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 140px;
  background: #f1f5f9;
}

/* Pagination */
.sepd-pg { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.sepd-pb {
  min-width: 38px; height: 38px; border: 1px solid #e2e8f0; border-radius: 8px;
  background: #fff; color: #475569; font-size: 14px; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; padding: 0 10px;
}
.sepd-pb:hover:not(:disabled):not(.act) { background: #f1f5f9; }
.sepd-pb.act { background: #41b87f; color: #fff; border-color: #41b87f; }
.sepd-pb:disabled { opacity: .4; cursor: default; }
.sepd-pi { font-size: 13px; color: #94a3b8; margin: 0 8px; }

/* Overlay & Detail Panel */
.sepd-ov {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 9998;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.sepd-ov.open { opacity: 1; pointer-events: auto; }
.sepd-dp {
  position: fixed; top: 0; right: -520px; width: 500px; max-width: 92vw; height: 100vh;
  background: #fff; z-index: 9999; box-shadow: -4px 0 25px rgba(0,0,0,.12);
  transition: right .3s cubic-bezier(.4,0,.2,1); overflow-y: auto; padding: 32px 28px;
}
.sepd-dp.open { right: 0; }
.sepd-dx {
  position: absolute; top: 16px; right: 16px; background: none; border: none;
  font-size: 24px; cursor: pointer; color: #94a3b8; line-height: 1; padding: 4px;
}
.sepd-dx:hover { color: #1e293b; }
.sepd-dt { font-size: 22px; font-weight: 700; margin-bottom: 20px; padding-right: 30px; }
.sepd-do { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.sepd-do img { height: 42px; object-fit: contain; }
.sepd-do span { font-size: 15px; font-weight: 500; color: #475569; }
.sepd-di {
  width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px;
  margin-bottom: 24px; background: #f1f5f9;
}

/* Detail panel buttons */
.sepd-da { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.sepd-db {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px;
  border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; font-size: 13px;
  font-weight: 500; cursor: pointer; transition: all .15s; color: #475569; text-decoration: none;
}
.sepd-db:hover { background: #f1f5f9; color: #475569; }
.sepd-db.pri { background: #41b87f; color: #fff; border-color: #41b87f; }
.sepd-db.pri:hover { background: #369e6b; color: #fff; }

/* Detail metadata */
.sepd-dm {}
.sepd-dr {
  display: flex; justify-content: space-between; padding: 12px 0;
  border-bottom: 1px solid #f1f5f9; font-size: 14px;
}
.sepd-dl { color: #64748b; font-weight: 500; }
.sepd-dv { color: #1e293b; text-align: right; max-width: 60%; }

/* Section headers in detail panel */
.sepd-sh {
  font-size: 17px; font-weight: 700; color: #1e293b;
  margin-top: 24px; margin-bottom: 4px; padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
}

/* Loading & empty states */
.sepd-ld, .sepd-em { text-align: center; padding: 48px 20px; color: #94a3b8; font-size: 15px; }
.sepd-sp {
  width: 32px; height: 32px; border: 3px solid #e2e8f0; border-top-color: #41b87f;
  border-radius: 50%; animation: sepd-spin .7s linear infinite; margin: 0 auto 12px;
}

.sepd-dd { position: relative; display: inline-block; }

.sepd-dd-toggle .sepd-dd-caret { margin-left: 6px; }

.sepd-dd-menu{
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  max-width: 420px;
  background: #fff;
  border: 1px solid #d9e1ea;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: 6px;
  z-index: 50;
}

.sepd-dd.open .sepd-dd-menu { display: block; }

.sepd-dd-item{
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2937;
  white-space: normal;          /* allow wrapping */
  overflow-wrap: anywhere;      /* break very long words/URLs */
  word-break: break-word;       /* fallback */
}

.sepd-dd-item:hover { background: #f3f4f6; }

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

@media (max-width: 640px) {
  .sepd-grid { grid-template-columns: 1fr; }
  .sepd-ci { width: 100px; min-height: 90px; }
  .sepd-dp { width: 100vw; max-width: 100vw; }
  .sepd-filters { flex-direction: column; }
  .sepd-fg, .sepd-fg-dd { flex-basis: 100%; }
  .sepd-date-panel { width: 100%; min-width: 0; }
}

@media (max-width: 460px) {
  .sepd-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }
}
