:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182031;
  background: #edf0f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 10% 20%, rgba(194, 159, 91, .2), transparent 28rem),
    linear-gradient(140deg, #10192a 0%, #1e2c43 62%, #263b54 100%);
}

.login-card {
  width: min(100%, 460px);
  padding: 44px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 80px rgba(0,0,0,.3);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 13px;
  background: #17243a;
  color: #d9b977;
  font: 700 23px Georgia, serif;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8b682e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 { margin: 0; font: 600 clamp(27px, 4vw, 38px)/1.15 Georgia, serif; }
.intro { margin: 16px 0 28px; color: #5c6678; line-height: 1.6; }
form { display: grid; gap: 12px; }
label { font-size: 14px; font-weight: 700; }
input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #b8c0cc;
  border-radius: 9px;
  outline: none;
}
input:focus { border-color: #8b682e; box-shadow: 0 0 0 3px rgba(139,104,46,.16); }
button {
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: #18263c;
  color: white;
  cursor: pointer;
  font-weight: 750;
}
button:hover { background: #263b59; }
button:disabled { cursor: wait; opacity: .65; }
.text-button { background: transparent; color: #5b6574; }
.text-button:hover { background: #f0f2f5; }
.sent-note { margin: 0 0 5px; color: #596478; font-size: 14px; line-height: 1.5; }
.error { min-height: 22px; color: #a32828; font-size: 14px; }

.viewer { min-height: 100vh; padding-bottom: 80px; }
.toolbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px max(24px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid #d2d7df;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.toolbar h1 { font-size: 23px; }
.viewer-account { display: flex; align-items: center; gap: 16px; color: #596478; font-size: 14px; }
.secondary { min-height: 38px; background: #e7eaf0; color: #263246; }
.secondary:hover { background: #d9dee7; }
.notice {
  padding: 10px 20px;
  background: #f6edda;
  color: #6a4c19;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
}
.pages {
  display: grid;
  gap: 28px;
  width: min(100% - 32px, 1020px);
  margin: 34px auto;
}
.page {
  min-height: 600px;
  border: 1px solid #cdd2d9;
  background: white;
  box-shadow: 0 8px 28px rgba(27,37,54,.15);
  user-select: none;
}
.page img {
  display: block;
  width: 100%;
  min-height: 200px;
  user-select: none;
  -webkit-user-drag: none;
}
.document-error { text-align: center; color: #9f2929; }
.admin { min-height: 100vh; padding-bottom: 70px; }
.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(520px, 1fr);
  gap: 24px;
  width: min(100% - 40px, 1240px);
  margin: 32px auto;
  align-items: start;
}
.admin-card {
  padding: 28px;
  border: 1px solid #d1d6de;
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 26px rgba(27,37,54,.09);
}
.admin-card h2 { margin: 0; font: 600 25px/1.2 Georgia, serif; }
.muted { color: #5c6678; line-height: 1.55; }
.status { min-height: 22px; color: #40516a; font-size: 14px; line-height: 1.5; }
.table-wrap { margin-top: 22px; overflow: auto; border: 1px solid #d9dde4; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e2e5ea; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: #f2f4f7; color: #455166; }
tr:last-child td { border-bottom: 0; }
.access-enabled { color: #17633a; font-weight: 750; }
.access-disabled { color: #9f2929; font-weight: 750; }
.small-button { min-height: 32px; padding: 5px 10px; font-size: 12px; }

@media (max-width: 680px) {
  .login-card { padding: 32px 24px; }
  .toolbar { align-items: flex-start; padding: 14px 18px; }
  .viewer-account { align-items: flex-end; flex-direction: column; gap: 7px; }
  #viewerEmail { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  .page { min-height: 300px; }
  .admin-grid { grid-template-columns: 1fr; width: min(100% - 24px, 1240px); }
  .admin-card { padding: 22px 18px; }
}

@media (min-width: 681px) and (max-width: 980px) {
  .admin-grid { grid-template-columns: 1fr; }
}

@media print {
  body * { display: none !important; }
  body::before { content: "Printing is disabled for this confidential document."; display: block; padding: 40px; }
}
