:root {
  --ink: #14213d;
  --ink-soft: #2d3b5c;
  --paper: #f2f1ec;
  --panel: #fbfaf7;
  --brass: #a9822c;
  --ledger-green: #1f5f5b;
  --text: #1b1d22;
  --text-muted: #565b66;
  --line: #d8d5c9;
  --radius: 3px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, sans-serif;
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--ink);
  margin: 0 0 0.4em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site-header {
  background: var(--ink);
  border-bottom: 3px solid var(--brass);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  flex-direction: column;
  color: #fff;
}

.brand .name-en {
  font-family: "Source Serif 4", serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
}

.brand .name-bn {
  font-size: 0.85rem;
  color: #cfd4e4;
}

.brand-logo {
  max-height: 36px;
  max-width: 200px;
  display: block;
  margin-bottom: 2px;
}

.brand .slogan {
  display: block;
  font-size: 0.72rem;
  color: var(--brass);
  margin-top: 2px;
  font-style: italic;
}

nav.main-nav {
  display: flex;
  gap: 28px;
}

nav.main-nav a {
  margin-left: 28px;
}

nav.main-nav a:first-child {
  margin-left: 0;
}

nav.main-nav a {
  color: #dfe3ee;
  font-size: 0.95rem;
}

nav.main-nav a.active,
nav.main-nav a:hover {
  color: var(--brass);
  text-decoration: none;
}

/* Hero */
.hero {
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
}

.hero .eyebrow-line {
  width: 48px;
  height: 3px;
  background: var(--brass);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 2.4rem;
  max-width: 620px;
}

.hero p.lede {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-top: 14px;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 14px;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ink-soft);
  text-decoration: none;
}

.btn-outline {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.btn-outline:hover {
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-danger {
  border-color: #8a2c2c;
  color: #8a2c2c;
  background: transparent;
}

/* Section */
.section {
  padding: 48px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: 1.5rem;
}

.section-head .see-all {
  font-size: 0.9rem;
  color: var(--ledger-green);
}

/* Register / list table */
.register {
  width: 100%;
  border-collapse: collapse;
}

.register th {
  text-align: left;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
}

.register td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.94rem;
}

.register tr:hover td {
  background: var(--panel);
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--panel);
  white-space: nowrap;
}

.tag-authority-Bangladesh\ Bank { border-color: #1f5f5b55; color: var(--ledger-green); }
.tag-authority-BSEC { border-color: #a9822c55; color: var(--brass); }
.tag-authority-NBR { border-color: #14213d55; color: var(--ink); }

.circular-title, .job-title {
  font-weight: 600;
  color: var(--text);
}

.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.quick-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 28px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.filter-field input,
.filter-field select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.92rem;
  background: #fff;
  min-width: 160px;
}

/* Job rows */
.job-row {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.job-row:first-child {
  padding-top: 0;
}

.job-row .job-body {
  flex: 1;
}

.job-row .job-company {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 2px 0 8px;
}

.job-row .job-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 620px;
}

.job-row .job-side {
  text-align: right;
  min-width: 130px;
}

.job-row .job-deadline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 36px 0 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  padding-bottom: 24px;
}

.footer-col h4 {
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 10px;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 6px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--ledger-green);
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-social a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-social a:hover {
  color: var(--brass);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Forms (admin) */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.overview-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.overview-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.overview-value {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.6rem;
  color: var(--ink);
  font-weight: 600;
}

.admin-shell {
  padding: 40px 0 60px;
}

.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 520px;
}

.admin-card.wide {
  max-width: 720px;
}

.form-field {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-field textarea {
  min-height: 90px;
  resize: vertical;
}

.error-msg {
  background: #fbe9e7;
  border: 1px solid #c0392b55;
  color: #8a2c2c;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.admin-table-wrap {
  margin-bottom: 46px;
}

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

.row-actions form {
  display: inline;
}

/* Economic Dashboard */
.indicator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.indicator-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brass);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.indicator-card:nth-child(3n+2) {
  border-top-color: var(--ledger-green);
}

.indicator-card:nth-child(3n+3) {
  border-top-color: var(--ink-soft);
}

.indicator-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.indicator-value {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.75rem;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
}

.indicator-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.indicator-source {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* Promo band (Standards / News teasers) */
.promo-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.promo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.promo-card p {
  margin: 8px 0 14px;
}

/* Easy Understanding explainer panel */
.explainer-panel {
  max-width: 680px;
  background: var(--panel);
  border-left: 3px solid var(--ledger-green);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 30px;
}

.explainer-panel p {
  color: var(--text);
  font-size: 0.95rem;
}

/* Infographic thumbnails and detail view */
.thumb-link {
  display: block;
  width: 84px;
}

.thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}

.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--panel);
  padding: 6px;
  line-height: 1.3;
}

.thumb-preview {
  max-width: 260px;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.detail-head {
  max-width: 680px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 26px;
  margin-bottom: 30px;
}

.infographic-panel {
  display: flex;
  justify-content: center;
}

.infographic-full {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.about-body {
  max-width: 680px;
}

.about-body p {
  margin-bottom: 16px;
  color: var(--text);
}

.empty-state {
  padding: 40px 0;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Make wide tables scroll horizontally instead of overflowing on mobile */
.register {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.register thead,
.register tbody,
.register tr {
  width: 100%;
}

/* ---- Mobile responsiveness ---- */
@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  nav.main-nav {
    flex-wrap: wrap;
    row-gap: 8px;
    width: 100%;
  }

  nav.main-nav a {
    margin-left: 0;
    margin-right: 18px;
    font-size: 0.88rem;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p.lede {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    text-align: center;
  }

  .section {
    padding: 28px 0;
  }

  .indicator-grid,
  .promo-band,
  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-field input,
  .filter-field select {
    min-width: 0;
    width: 100%;
  }

  .job-row {
    flex-direction: column;
  }

  .job-side {
    text-align: left;
    width: 100%;
  }

  .job-side .btn {
    width: 100%;
    text-align: center;
  }

  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .thumb-link,
  .thumb,
  .thumb-empty {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 400px) {
  .indicator-grid,
  .promo-band,
  .overview-grid,
  .footer-columns {
    grid-template-columns: 1fr;
  }
}

/* Chat widget */
.chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 33, 61, 0.35);
  z-index: 60;
}

.chat-launcher:hover {
  background: var(--ink-soft);
}

.chat-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(20, 33, 61, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
}

.chat-panel.open {
  display: flex;
}

.chat-panel-header {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 600;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.chat-login-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-login-form .form-field {
  margin-bottom: 0;
}

.chat-body {
  display: none;
  flex-direction: column;
  height: 420px;
  max-height: 60vh;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--paper);
}

.chat-msg {
  display: flex;
}

.chat-msg-visitor {
  justify-content: flex-end;
}

.chat-msg-bot {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.chat-msg-visitor .chat-bubble {
  background: var(--ink);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.chat-msg-bot .chat-bubble {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-bottom-left-radius: 3px;
}

.chat-typing .chat-bubble {
  color: var(--text-muted);
  font-style: italic;
}

.chat-send-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-send-form input {
  flex: 1;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .chat-panel {
    right: 16px;
    bottom: 80px;
    width: calc(100vw - 32px);
  }

  .chat-launcher {
    right: 16px;
    bottom: 16px;
    padding: 12px 18px;
    font-size: 0.85rem;
  }
}

/* Admin chat thread view */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
}

.chat-thread-msg {
  max-width: 80%;
}

.chat-thread-visitor {
  align-self: flex-start;
}

.chat-thread-bot,
.chat-thread-admin {
  align-self: flex-end;
}

.chat-thread-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.chat-thread-bubble {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.chat-thread-admin .chat-thread-bubble,
.chat-thread-bot .chat-thread-bubble {
  background: var(--ink);
  color: #fff;
  border: none;
}

/* Community Q&A */
.qa-ask-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 620px;
}

.qa-ask-card h2 {
  margin-bottom: 14px;
}

.qa-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qa-item {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: #fff;
}

.qa-item:hover {
  background: var(--panel);
  text-decoration: none;
}

.qa-item-question {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.qa-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.qa-question-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  max-width: 680px;
}

.qa-question-text {
  font-size: 1.05rem;
  color: var(--text);
  margin: 10px 0 14px;
  white-space: pre-line;
}

.qa-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 680px;
  margin-bottom: 10px;
}

.qa-answer {
  border-left: 3px solid var(--ledger-green);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.qa-answer p {
  margin: 6px 0 0;
  white-space: pre-line;
}

.qa-posted-banner {
  background: #eaf5f0;
  border: 1px solid var(--ledger-green);
  border-radius: var(--radius);
  padding: 16px 18px;
  max-width: 680px;
  margin-bottom: 24px;
}

.qa-posted-banner p {
  margin: 0 0 10px;
}

/* RSS import panel (News admin) */
.rss-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  background: #fff;
}

.rss-item:hover {
  background: var(--panel);
  border-color: var(--ledger-green);
}

.rss-item-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}
