:root {
  --canvas: #f8f2ec;
  --canvas-accent: #f6e7dc;
  --panel: rgba(255, 252, 249, 0.88);
  --panel-strong: #fffaf5;
  --line: rgba(125, 99, 83, 0.18);
  --ink: #3d3a38;
  --muted: #73655b;
  --rose: #cc8c8c;
  --rose-deep: #b87070;
  --mint: #89b9aa;
  --mint-deep: #5f9283;
  --gold: #d8b07a;
  --shadow: 0 18px 44px rgba(108, 82, 67, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Aptos, Candara, "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(204, 140, 140, 0.2), transparent 28%),
    radial-gradient(circle at bottom right, rgba(137, 185, 170, 0.22), transparent 30%),
    linear-gradient(135deg, #fbf6f1 0%, #f5eee7 48%, #efe8e2 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.login-body,
.app-body {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 620px) minmax(240px, 360px);
  gap: 28px;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card,
.login-note,
.sidebar,
.viewer-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-card {
  border-radius: 28px;
  padding: 34px;
}

.login-note {
  border-radius: 24px;
  padding: 28px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-note ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.brand-strip,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-coma {
  width: 188px;
  max-width: 100%;
  height: auto;
}

.brand-ciomex-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  padding: 12px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--mint-deep), #6ba798);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-ciomex-pill.compact {
  min-height: 58px;
  padding: 10px 14px;
}

.brand-ciomex {
  width: 156px;
  max-width: 100%;
  height: auto;
}

.eyebrow {
  margin: 20px 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

h1,
h2,
p {
  margin: 0;
}

.login-card h1,
.sidebar-copy h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.05;
}

.login-card h1 {
  font-size: clamp(34px, 6vw, 54px);
  max-width: 10ch;
}

.lead,
.sidebar-copy p,
.viewer-header p {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 12px;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.login-form label {
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid rgba(110, 85, 68, 0.18);
  border-radius: 16px;
  padding: 16px 18px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
}

.login-form input:focus {
  outline: 2px solid rgba(184, 112, 112, 0.28);
  border-color: rgba(184, 112, 112, 0.4);
}

.login-form button,
.secondary-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.login-form button {
  margin-top: 8px;
  color: #fffaf8;
  background: linear-gradient(135deg, var(--rose-deep), #c88e7e);
}

.secondary-button {
  width: 100%;
  color: var(--mint-deep);
  background: rgba(137, 185, 170, 0.12);
  border: 1px solid rgba(95, 146, 131, 0.18);
}

.login-form button:hover,
.secondary-button:hover,
.nav-link:hover {
  transform: translateY(-1px);
}

.login-error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(204, 140, 140, 0.14);
  color: #8f5151;
  border: 1px solid rgba(184, 112, 112, 0.18);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.sidebar {
  border-radius: 28px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.sidebar-copy h1 {
  font-size: 40px;
  margin-top: 4px;
}

.report-nav {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.nav-link {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid transparent;
}

.nav-link span {
  font-weight: 700;
}

.nav-link small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.nav-link.active {
  background: rgba(137, 185, 170, 0.16);
  border-color: rgba(95, 146, 131, 0.24);
}

.logout-form {
  margin-top: auto;
  padding-top: 18px;
}

.viewer-panel {
  border-radius: 28px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 36px);
}

.viewer-header {
  padding: 8px 6px 18px;
}

.viewer-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
}

.viewer-frame-wrap {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(125, 99, 83, 0.14);
  background: var(--panel-strong);
  min-height: 0;
}

.viewer-frame {
  width: 100%;
  height: 100%;
  min-height: 78vh;
  border: 0;
  background: #fff;
}

@media (max-width: 980px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .viewer-panel {
    min-height: auto;
  }

  .sidebar-copy h1 {
    font-size: 34px;
  }
}

@media (max-width: 640px) {
  .login-card,
  .login-note,
  .sidebar,
  .viewer-panel {
    border-radius: 22px;
  }

  .login-card,
  .login-note,
  .sidebar {
    padding: 22px;
  }

  .brand-coma {
    width: 152px;
  }

  .brand-ciomex {
    width: 128px;
  }
}