:root {
  --ism-red: #e11d2d;
  --ism-green: #1fa25a;
  --ism-yellow: #f4c542;
  --ism-black: #173b2b;
  --ism-ink: #18352a;
  --ism-surface: #f5f4f1;
  --ism-surface-strong: #ffffff;
  --ism-border: rgba(31, 162, 90, 0.16);
  --ism-muted: #5e6775;
  --bs-primary: var(--ism-red);
  --bs-success: var(--ism-green);
  --bs-warning: var(--ism-yellow);
  --bs-body-bg: #f4f4f2;
}

body {
  background: linear-gradient(180deg, #f7f6f3 0%, #f0f2ee 100%);
  color: var(--ism-ink);
}

.btn .bi,
.navbar .bi,
h1 .bi {
  margin-right: 0.35rem;
  vertical-align: -0.08em;
}

.login-logo {
  filter: drop-shadow(0 8px 14px rgba(31, 162, 90, 0.12));
}

main.container {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.navbar {
  background: #ffffff !important;
  border-bottom: 3px solid var(--ism-green);
  box-shadow: 0 5px 16px rgba(24, 53, 42, 0.08) !important;
}

.navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ism-ink) !important;
}

.navbar .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(31, 162, 90, 0.08);
  padding: 4px;
}

.navbar .btn {
  border-radius: 0.7rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.navbar .btn-outline-light {
  border-color: rgba(31, 162, 90, 0.35);
  color: var(--ism-green);
}

.navbar .btn-outline-light:hover {
  background: var(--ism-green);
  border-color: var(--ism-green);
  color: #fff;
}

.navbar .btn-light {
  background: var(--ism-green);
  border-color: var(--ism-green);
  color: #fff;
}

.navbar .btn-light:hover {
  background: #17864a;
  border-color: #17864a;
  color: #fff;
}

.navbar .btn:hover,
.btn:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  padding: 2.2rem 2rem;
  color: var(--ism-ink);
  background: linear-gradient(135deg, #ffffff 0%, #f7fff9 62%, #e8f6ed 100%);
  border: 1px solid rgba(31, 162, 90, 0.18);
  box-shadow: 0 16px 28px rgba(24, 53, 42, 0.08);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -20% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(31, 162, 90, 0.12);
  filter: blur(18px);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
}

.hero p {
  max-width: 700px;
  color: #4f6d5d;
  font-size: 1.02rem;
}

.hero .btn {
  border-radius: 0.7rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--ism-green);
  border-color: var(--ism-green);
  color: #fff;
}

#alertArea {
  margin-bottom: 1.25rem;
}

.alert {
  border: 0;
  border-radius: 0.9rem;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.04);
}

.card {
  border: 1px solid var(--ism-border);
  border-radius: 1.25rem;
  background: var(--ism-surface-strong);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(17, 17, 17, 0.08);
  border-color: rgba(225, 29, 45, 0.15);
}

.card-body,
.card-footer {
  padding: 1rem 1rem 0.9rem;
}

.card-img-top {
  position: relative;
  border-top-left-radius: 1.25rem;
  border-top-right-radius: 1.25rem;
  background: linear-gradient(135deg, #f8f8f8, #eceae6);
}

.cover-brand-logo {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 62px;
  height: 62px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(17, 17, 17, 0.05);
  object-fit: contain;
  box-shadow: 0 8px 14px rgba(17, 17, 17, 0.08);
  z-index: 1;
}

#documentsGrid .card .category-badge {
  border-radius: 999px;
  padding: 0.5rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(31, 162, 90, 0.12);
  color: #167342;
}

#documentsGrid .card h3 {
  font-size: 1.06rem;
  line-height: 1.35;
  color: var(--ism-ink);
  margin-bottom: 0.45rem;
}

#documentsGrid .card p {
  font-size: 0.92rem;
  color: var(--ism-muted);
}

#documentsGrid .card .btn {
  padding: 0.42rem 0.72rem;
  border-radius: 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

#documentsGrid .card .btn-outline-primary {
  border-color: rgba(225, 29, 45, 0.2);
  color: var(--ism-red);
}

#documentsGrid .card .btn-outline-primary:hover {
  background: var(--ism-red);
  border-color: var(--ism-red);
  color: #fff;
}

#documentsGrid .card .btn-outline-secondary {
  border-color: rgba(17, 17, 17, 0.12);
  color: var(--ism-ink);
}

#documentsGrid .card .btn-outline-danger {
  border-color: rgba(225, 29, 45, 0.18);
}

#searchInput,
.form-control,
.form-select {
  border-radius: 0.9rem;
  border: 1px solid rgba(17, 17, 17, 0.1);
  min-height: 48px;
  box-shadow: none;
  background: #fff;
}

#searchInput:focus,
.form-control:focus,
.form-select:focus {
  border-color: rgba(225, 29, 45, 0.35);
  box-shadow: 0 0 0 0.2rem rgba(225, 29, 45, 0.08);
}

#searchBtn,
.btn-primary {
  border-radius: 0.9rem;
  min-height: 48px;
  font-weight: 600;
  background: var(--ism-red);
  border-color: var(--ism-red);
}

#searchBtn:hover,
.btn-primary:hover {
  background: #c81425;
  border-color: #c81425;
}

#documentCount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 999px;
  background: rgba(31, 162, 90, 0.12);
  color: var(--ism-green);
  font-size: 0.78rem;
  font-weight: 700;
}

.pagination .page-link {
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 0.7rem;
  color: var(--ism-ink);
  min-width: 2.8rem;
  min-height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.2rem;
  background: #fff;
}

.pagination .page-item.active .page-link {
  background: var(--ism-red);
  border-color: var(--ism-red);
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  color: #96a0ad;
  background: #f2f4f7;
}

.card.shadow-sm {
  border-color: rgba(17, 17, 17, 0.06);
}

.table th {
  white-space: nowrap;
}

.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: .35rem;
  flex-wrap: wrap;
}

.document-title {
  font-weight: 600;
}

.document-description {
  max-width: 420px;
  color: #6c757d;
}

.logo-container {
  margin-bottom: 28px;
}

.login-logo {
  display: block;
  width: 260px;
  max-width: 80%;
  height: auto;
  margin: 0 auto;
}

.reader-page {
  background: #f1f8f3;
}

.reader-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.eyebrow {
  color: var(--ism-green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.reader-controls .btn {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.6rem;
}

.zoom-value {
  min-width: 3.6rem;
  color: var(--ism-ink);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.reader-status {
  padding: 4rem 1rem;
  color: var(--ism-muted);
  text-align: center;
}

.pdf-viewer {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--ism-border);
  border-radius: 1rem;
  background: #dfeee4;
}

.pdf-page {
  max-width: 100%;
  overflow: auto;
  background: #fff;
  box-shadow: 0 8px 20px rgba(24, 53, 42, 0.12);
}

.pdf-page canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.dashboard-chart {
  position: relative;
  min-height: 260px;
}

.dashboard-timeline-chart {
  min-height: 340px;
}

.collection-total {
  display: grid;
  justify-items: end;
  color: var(--ism-ink);
}

.collection-total span:first-child {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.collection-total span:last-child {
  color: var(--ism-muted);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .hero {
    padding: 1.5rem 1.2rem;
  }

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

  .card-body,
  .card-footer {
    padding: 1rem 1rem 0.9rem;
  }

  .reader-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .reader-controls {
    align-self: stretch;
    justify-content: flex-end;
  }
}