* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: #113e18;
  background: #f6f7f2;
  font:
    15px/1.6 system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  border: 1px solid #00792d;
  border-radius: 8px;
  padding: 10px 18px;
  background: #00792d;
  color: white;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  background: #113e18;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
input,
select {
  border: 1px solid #c8d3cb;
  background: white;
  border-radius: 7px;
  padding: 11px 12px;
  width: 100%;
  color: #113e18;
}
label {
  font-weight: 600;
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #9aab20;
  outline-offset: 3px;
}
.topbar {
  height: 88px;
  background: #fff;
  border-bottom: 1px solid #dce3d9;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}
.mark {
  background: #ccd200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  font-size: 31px;
}
.topbar nav {
  display: flex;
  gap: 24px;
  font-size: 14px;
}
.topbar nav a {
  text-decoration: none;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 35px 30px;
}
.wide {
  max-width: 1600px;
}
.narrow {
  max-width: 780px;
}
.intro {
  padding: 22px 0 37px;
}
.eyebrow {
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 750;
  color: #52705a;
}
h1 {
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 550;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin: 14px 0 20px;
}
h2 {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.intro > p:last-child {
  font-size: 17px;
  color: #637468;
}
.filters {
  display: flex;
  align-items: end;
  gap: 14px;
  background: #fff;
  padding: 22px;
  border: 1px solid #dce3d9;
  border-radius: 12px;
  flex-wrap: wrap;
}
.search-field {
  flex: 1;
  min-width: 230px;
}
.filters > div:not(.search-field) {
  min-width: 150px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0;
}
.checkbox input {
  width: auto;
}
.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 25px 0 18px;
}
.section-line > span {
  font-size: 13px;
  color: #68776d;
}
.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
}
.document-card {
  text-decoration: none;
  display: block;
  overflow: hidden;
  border: 1px solid #dce3d9;
  border-radius: 12px;
  background: #fff;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.document-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px #113e1810;
}
.cover {
  height: 215px;
  background: #e5eadb;
  position: relative;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.document-card:nth-child(3n + 2) .cover {
  background: #e9e5d8;
}
.document-card:nth-child(3n + 3) .cover {
  background: #dce9e4;
}
.entity-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 750;
  padding: 4px 9px;
  border-radius: 4px;
  background: #ffffffc9;
  color: #315441;
}
.cover .entity-tag {
  position: absolute;
  top: 18px;
  left: 18px;
}
.paper-symbol {
  display: block;
  width: 89px;
  height: 120px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 8px 8px 0 #113e1810;
  transform: rotate(-8deg);
  font-size: 55px;
  text-align: center;
  line-height: 105px;
  color: #a5b5a0;
}
.pdf-tag {
  position: absolute;
  bottom: 17px;
  right: 20px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #5b7060;
}
.card-info {
  padding: 21px 23px;
}
.card-info h3 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 9px;
  overflow-wrap: anywhere;
}
.card-info p {
  font-size: 11px;
  color: #758075;
  overflow-wrap: anywhere;
  margin: 0 0 24px;
}
.read-link {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 650;
}
.library-footer {
  border-top: 1px solid #dce3d9;
  margin-top: 55px;
  padding: 25px 0;
  font-size: 12px;
  color: #738071;
}
.empty {
  padding: 50px;
  background: white;
  grid-column: 1/-1;
  border-radius: 12px;
}
.pagination {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 30px 0;
  font-size: 14px;
}
.table-scroll {
  overflow: auto;
  background: white;
  border: 1px solid #dce3d9;
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 18px;
  text-align: left;
  border-bottom: 1px solid #e4e9e1;
  min-width: 160px;
  vertical-align: top;
}
th {
  background: #eaf0e6;
}
td a {
  overflow-wrap: anywhere;
}
td form {
  margin-top: 12px;
}
.secondary {
  background: white;
  color: #113e18;
  padding: 5px 10px;
  margin: 10px 0;
}
.danger {
  color: #922a27;
  background: white;
  border-color: #dcbbb8;
  padding: 5px 10px;
}
.danger:hover {
  background: #f8e6e4;
}
.form-panel {
  padding: 30px;
  background: white;
  border: 1px solid #dce3d9;
  border-radius: 12px;
}
.form-panel form > div {
  margin: 0 0 20px;
}
.form-panel ul {
  color: #a12e28;
}
.preview {
  padding: 20px;
  background: #f2f5ed;
  margin: 25px 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.flash {
  padding: 15px 5vw;
  background: #e4efd8;
}
.flash.error {
  background: #fbe6df;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #113e18;
  color: white;
  padding: 14px 24px;
  border-radius: 10px;
  z-index: 100;
}
.reader-page {
  height: 100dvh;
  overflow: hidden;
}
.reader-page .topbar {
  height: 65px;
}
.reader-heading {
  height: 68px;
  padding: 10px 25px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.reader-heading h1 {
  font-size: 17px;
  letter-spacing: 0;
  margin: 0;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-heading > a {
  font-size: 12px;
}
#viewport {
  height: calc(100dvh - 225px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 10px 35px;
  background: radial-gradient(ellipse at center, #edf0e7, #dae3d5);
}
#book {
  flex: none;
  position: relative;
}
.sheet {
  background: white;
}
.sheet img {
  visibility: hidden;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}
.sheet img.is-ready {
  visibility: visible;
}

.reader-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 13px;
  padding: 12px;
  height: 65px;
  background: #fff;
}
.reader-controls button {
  font-size: 12px;
  padding: 7px 13px;
}
#counter {
  min-width: 80px;
  text-align: center;
  font-size: 12px;
}
#reader-status {
  font-size: 12px;
  margin: 0;
  height: 27px;
  text-align: center;
  background: #fff;
}
.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow {
  display: none !important;
}
#book.binding:after {
  content: "";
  position: absolute;
  z-index: 15;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 22px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #113e1822, transparent);
}
@media (max-width: 800px) {
  .document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    padding: 15px;
  }
  .topbar {
    padding: 0 20px;
  }
  .container {
    padding: 25px 18px;
  }
  .filters button {
    flex: 1;
  }
  .section-line {
    flex-wrap: wrap;
  }
}
@media (max-width: 520px) {
  .document-grid {
    grid-template-columns: 1fr;
  }
  .topbar nav {
    font-size: 12px;
    gap: 12px;
  }
  .intro {
    padding: 10px 0 20px;
  }
  .cover {
    height: 190px;
  }
  .filters > div {
    flex: 1;
  }
  .reader-heading {
    padding: 10px;
    gap: 8px;
  }
  .reader-heading h1 {
    font-size: 13px;
  }
  .reader-heading .entity-tag {
    display: none;
  }
  #viewport {
    padding: 5px 10px;
  }
  .reader-controls {
    gap: 7px;
  }
  .reader-controls button {
    padding: 7px 9px;
    font-size: 11px;
  }
  .form-panel {
    padding: 18px;
  }
}

.mutualia-logo {
  display: block;
  width: 150px;
  height: auto;
}
.brand {
  gap: 24px;
}
.app-brand {
  border-left: 1px solid #dce3d9;
  padding-left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  letter-spacing: -0.3px;
}
.application-logo {
  object-fit: contain;
  width: 44px;
  height: 44px;
}
.app-brand small {
  font-size: 9px;
  letter-spacing: 1px;
}
.intro h1 {
  color: #113e18;
}
.reader-page .mutualia-logo {
  width: 120px;
}
.topbar {
  border-bottom: 3px solid #ccd200;
}
@media (max-width: 600px) {
  .app-brand {
    padding-left: 10px;
    font-size: 13px;
    gap: 5px;
  }
  .app-brand small {
    font-size: 8px;
  }
  .brand {
    gap: 10px;
  }
  .mutualia-logo {
    width: 110px;
  }
  .application-logo {
    width: 32px;
    height: 32px;
  }
  .topbar nav {
    gap: 8px;
  }
}
#reader:fullscreen {
  background: #f6f7f2;
  height: 100dvh;
}
#reader:fullscreen #viewport {
  height: calc(100dvh - 160px);
}

@media (max-width: 600px) {
  .management-page .topbar {
    height: auto;
    min-height: 88px;
    flex-wrap: wrap;
    padding: 12px 18px;
    gap: 10px;
  }
  .management-page .topbar nav {
    width: 100%;
    justify-content: flex-end;
  }
  .management-page .app-brand {
    font-size: 14px;
  }
  .management-page .section-line h1 {
    font-size: 30px;
  }
}
.secondary:hover {
  background: #e6f0e8;
  color: #113e18;
}

/* Identity card follows EAV: display name, AD login, entity and privileged actions. */
.app-brand {
  border-left: 0;
  padding-left: 0;
}
.topbar-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  min-width: 0;
}
.user-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  padding: 8px 14px;
  border: 1px solid #dce3d9;
  border-radius: 12px;
  background: #f4f8f3;
  max-width: 350px;
}
.user-card-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.user-card-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 235px;
  white-space: nowrap;
}
.user-card-login {
  color: #637468;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.user-card-badges {
  display: flex;
  gap: 5px;
}
.user-badge {
  border-radius: 5px;
  padding: 2px 6px;
  background: #dceacb;
  font-size: 10px;
  font-weight: 700;
}
.impersonation-link,
.grants-link {
  font-size: 11px;
  color: #00792d;
  font-weight: 600;
}
.impersonation-active {
  color: #825218;
}
.reader-page {
  display: flex;
  flex-direction: column;
}
.reader-page > .topbar {
  flex: none;
}
.reader-page #reader {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.reader-page #viewport {
  flex: 1;
  min-height: 0;
  height: auto;
}
.reader-heading,
.reader-controls,
#reader-status {
  flex: none;
}
@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 88px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 20px;
  }
  .topbar-end {
    gap: 12px;
    flex-wrap: wrap;
  }
  .reader-page .topbar {
    height: auto;
    min-height: 65px;
  }
}
@media (max-width: 600px) {
  .topbar-end {
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
  }
  .topbar-end .user-card {
    max-width: 100%;
  }
  .management-page .topbar nav {
    width: auto;
  }
  .reader-page .topbar {
    padding: 8px 12px;
  }
  .reader-page .topbar-end {
    width: auto;
    flex: 1;
  }
  .reader-page .user-card {
    max-width: 165px;
    padding: 5px 8px;
  }
  .reader-page .user-card-name {
    max-width: 145px;
    font-size: 11px;
  }
  .reader-page .user-card-login {
    font-size: 10px;
  }
}

/* Fit the actual content box, including landscape PDFs; only zoom enables panning. */
.reader-page #viewport {
  overflow: hidden;
}
.reader-page #viewport.is-zoomed {
  overflow: auto;
  scrollbar-width: none;
}
.reader-page #viewport.is-zoomed::-webkit-scrollbar {
  display: none;
}

/* Reader controls: two compact groups, clear actions and comfortable touch targets. */
.sheet img.is-ready {
  visibility: visible;
}

.reader-controls {
  height: auto;
  min-height: 82px;
  padding: 16px 20px;
  gap: 22px;
  border-top: 1px solid #dce6d8;
  box-shadow: 0 -6px 24px #113e1805;
}
.page-navigation,
.reader-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.reader-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 17px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.16s,
    box-shadow 0.16s,
    transform 0.16s;
}
.reader-controls button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px #113e1815;
}
.reader-controls button:active:not(:disabled) {
  transform: translateY(0);
}
.reader-controls svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.reader-controls .page-arrow {
  width: 44px;
  padding: 0;
  border: 0;
  background: #00792d;
  color: white;
}
.reader-controls .page-arrow:hover:not(:disabled) {
  background: #113e18;
}
.reader-controls .page-arrow:disabled {
  opacity: 1;
  color: #9baa9c;
  background: #edf2e9;
}
.reader-controls #counter {
  min-width: 76px;
  padding: 5px 12px;
  border-radius: 20px;
  background: #f3f6ef;
  color: #315440;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.control-divider {
  width: 1px;
  height: 28px;
  background: #dce6d8;
}
.reader-controls .reader-action {
  border: 1px solid #cbdcc9;
  background: white;
  color: #113e18;
}
.reader-controls .reader-action:hover {
  background: #edf5e8;
}
.reader-controls .reader-action-primary {
  background: #e7f1df;
  border-color: #e7f1df;
}
.reader-controls .reader-action-primary:hover {
  background: #d9eacb;
}
@media (max-width: 480px) {
  .reader-controls {
    min-height: 74px;
    padding: 12px;
    gap: 12px;
  }
  .reader-controls .control-label {
    display: none;
  }
  .reader-controls .reader-action {
    width: 44px;
    padding: 0;
  }
  .page-navigation,
  .reader-actions {
    gap: 7px;
  }
  .reader-controls #counter {
    min-width: 66px;
    padding: 5px 8px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reader-controls button {
    transition: none;
  }
}
