:root {
  --bg: #eef1f4;
  --ink: #17202a;
  --muted: #687483;
  --line: #d7dde3;
  --accent: #0f7a57;
  --accent-2: #ef233c;
  --panel: #ffffff;
  --sidebar-bg: #18222f;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --button-bg: #f8fafc;
  --input-bg: #ffffff;
  --table-head-bg: #eef6f9;
  --page-bg: #ffffff;
  --page-ink: #17202a;
  --grid: rgba(35, 48, 64, 0.12);
  --page-w: 794px;
  --page-h: 1123px;
}

body.dark {
  --bg: #101821;
  --ink: #e9eef5;
  --muted: #9aa8b8;
  --line: #314153;
  --panel: #182330;
  --sidebar-bg: #0d141d;
  --topbar-bg: rgba(16, 24, 33, 0.94);
  --button-bg: #223144;
  --input-bg: #111a25;
  --table-head-bg: #223144;
  --page-bg: #182433;
  --page-ink: #f4f7fb;
  --grid: rgba(214, 226, 241, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  display: grid;
  grid-template-columns: 360px 1fr;
}

body.auth-locked {
  display: block;
}

body.auth-locked .sidebar,
body.auth-locked .workspace {
  display: none;
}

.authOverlay,
.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 15, 22, 0.78);
}

.authOverlay[hidden],
.modalOverlay[hidden] {
  display: none;
}

.authCard,
.modalCard {
  width: min(440px, 100%);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.32);
}

.authCard {
  display: grid;
  gap: 12px;
}

.authCard strong {
  font-size: 22px;
}

.authCard span,
.modalHead span {
  color: var(--muted);
  font-size: 12px;
}

.authCard label,
.adminForm label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.authCard input,
.adminForm input,
.adminForm select {
  min-height: 34px;
  border: 1px solid #c7d0da;
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--input-bg);
  color: var(--ink);
}

.authError {
  min-height: 18px;
  color: #ef4444;
  font-size: 12px;
}

.modalCard {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
}

.startupTip {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  width: min(560px, calc(100vw - 32px));
}

.startupTip[hidden] {
  display: none;
}

.startupTipCard {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #f59e0b;
  border-top: 5px solid #ef233c;
  border-radius: 8px;
  background: #fff3a3;
  color: #1f2937;
  box-shadow: 0 18px 40px rgba(10, 15, 22, 0.28);
}

.startupTipCard strong {
  padding-right: 28px;
  font-size: 16px;
}

.startupTipCard p {
  margin: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.45;
}

.startupTipClose {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.startupTipCheck {
  margin-top: 2px;
  color: #374151;
}

.modalHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.modalHead div {
  display: grid;
  gap: 3px;
}

.drawerToggle {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.infoDrawerShell {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  visibility: hidden;
}

.infoDrawerBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 22, 0.38);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.infoDrawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(460px, 92vw);
  height: 100%;
  overflow: auto;
  background: var(--panel);
  color: var(--ink);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.24);
  transform: translateX(100%);
  transition: transform 0.18s ease;
  padding: 18px;
}

#drawerAbout:checked ~ .infoDrawerShell,
#drawerHelp:checked ~ .infoDrawerShell {
  pointer-events: auto;
  visibility: visible;
}

#drawerAbout:checked ~ .infoDrawerShell .infoDrawerBackdrop,
#drawerHelp:checked ~ .infoDrawerShell .infoDrawerBackdrop {
  opacity: 1;
}

#drawerAbout:checked ~ .infoDrawerShell .infoDrawer,
#drawerHelp:checked ~ .infoDrawerShell .infoDrawer {
  transform: translateX(0);
}

.drawerPage {
  display: none;
}

#drawerAbout:checked ~ .infoDrawerShell .drawerAboutPage,
#drawerHelp:checked ~ .infoDrawerShell .drawerHelpPage {
  display: grid;
  gap: 16px;
}

.drawerHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.drawerHead strong {
  font-size: 20px;
}

.adminForm {
  display: grid;
  grid-template-columns: 1fr 1fr 120px auto;
  gap: 10px;
  align-items: end;
}

.adminUsersWrap {
  max-height: 360px;
}

#adminPortalBtn.is-hidden {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 30px;
  border: 1px solid #b8c1cc;
  background: var(--button-bg);
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

button:hover {
  border-color: var(--accent);
}

.buttonLike {
  min-height: 30px;
  border: 1px solid #b8c1cc;
  background: var(--button-bg);
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.buttonLike:hover {
  border-color: var(--accent);
}

button.activeToggle {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.sidebar {
  height: 100vh;
  overflow: auto;
  padding: 18px;
  background: var(--sidebar-bg);
  color: #fff;
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.brand strong {
  font-size: 20px;
}

.brand span,
.panel h2 + span,
.mappingHead span {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel h2 {
  font-size: 13px;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.panelHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.panelHead h2 {
  margin: 0;
}

.panelMove {
  display: flex;
  gap: 4px;
}

.panelMove button {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 11px;
}

.panel label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

.panel input,
.panel select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #c7d0da;
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--input-bg);
  color: var(--ink);
}

.check {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.check input {
  width: 16px;
  min-height: 16px;
}

.segmented,
.toolbar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.formatToolbar button {
  min-height: 28px;
  padding-inline: 7px;
}

.formatToolbar #toggleBold,
.formatToolbar #toggleItalic,
.formatToolbar #toggleStrike {
  width: 32px;
  min-width: 32px;
  padding-inline: 0;
  text-align: center;
}

.formatToolbar #toggleBold {
  font-weight: 700;
}

.formatToolbar #toggleItalic {
  font-style: italic;
}

.formatToolbar #toggleStrike {
  text-decoration: line-through;
}

.formatToolbar select {
  min-height: 28px;
  max-width: 72px;
  border: 1px solid #b8c1cc;
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 12px;
}

.segmented {
  margin-bottom: 10px;
}

.tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.workspace {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 76px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar div:first-child {
  display: grid;
  gap: 3px;
}

.topbarActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.languageControl {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.languageControl select {
  min-height: 30px;
  border: 1px solid #b8c1cc;
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--input-bg);
  color: var(--ink);
}

.historyActions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.historyActions button {
  min-height: 26px;
  padding: 2px 10px;
  font-size: 12px;
}

.topbar span,
.status {
  color: var(--muted);
  font-size: 12px;
}

.status {
  display: none;
}

.canvasWrap {
  min-width: 900px;
  padding: 28px;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.page {
  position: relative;
  width: var(--page-w);
  height: var(--page-h);
  background: var(--page-bg);
  color: var(--page-ink);
  box-shadow: 0 18px 36px rgba(20, 32, 45, 0.24);
  overflow: hidden;
  flex: 0 0 auto;
}

body.dark .page {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(214, 226, 241, 0.08);
}

.page.landscape {
  --page-w: 1123px;
  --page-h: 794px;
}

.page.cell-paint-active {
  cursor: crosshair;
}

.grid {
  position: absolute;
  inset: 32px;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 18px 18px;
  background-size: var(--grid-size, 18px) var(--grid-size, 18px);
  pointer-events: none;
  z-index: 0;
}

.cellColors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.coloredCell {
  position: absolute;
  background: transparent;
  border: 0;
  box-sizing: border-box;
}

.items {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.item {
  position: absolute;
  min-width: 72px;
  min-height: 36px;
  border: 1px solid var(--accent-2);
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.item.selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.item.header,
.item.footer {
  border-color: #29384a;
  background: rgba(245, 247, 250, 0.96);
}

.item.title,
.item.logo,
.item.footerText,
.item.note,
.item.sectionTitle,
.item.tableText,
.item.photoPlaceholder,
.item.processStrip {
  border-color: transparent;
  background: transparent;
}

.item.logo {
  background: #ed1b3a;
}

.item.logo .content {
  padding: 7px 12px;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  font-weight: 700;
  text-align: center;
}

.item.title .content {
  padding: 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
}

.item.note .content {
  padding: 0;
  color: #f00000;
  font-size: 12px;
}

.item.field .content {
  padding-top: 18px;
}

.item.sectionTitle .content {
  padding: 0;
  font-size: 21px;
  font-weight: 700;
}

.item.question .content {
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.item.value .content {
  padding: 0;
  font-size: 12px;
}

.item.signature {
  border-color: #111;
}

.item.signature .content {
  padding: 8px;
  font-size: 12px;
}

.item.footerText .content {
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.item.photoPlaceholder {
  background:
    linear-gradient(135deg, rgba(220, 220, 220, 0.9), rgba(245, 245, 245, 0.95)),
    repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(0, 0, 0, 0.05) 12px, rgba(0, 0, 0, 0.05) 24px);
  border-color: #e4e7ea;
}

.item.photoPlaceholder .content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #5d6773;
  font-weight: 700;
}

.item.processStrip .content {
  padding: 0;
  color: #5f7162;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.item.tableText .content {
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.item.image {
  border-color: var(--accent-2);
  background: #f8fafc;
}

.item.image .content {
  padding: 18px 0 0;
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

body.dark .page .item {
  background: rgba(17, 25, 35, 0.88);
}

body.dark .page .item.header,
body.dark .page .item.footer {
  background: rgba(26, 38, 53, 0.94);
}

body.dark .page .item.title,
body.dark .page .item.footerText,
body.dark .page .item.note,
body.dark .page .item.sectionTitle,
body.dark .page .item.tableText,
body.dark .page .item.processStrip {
  background: transparent;
}

body.dark .page .item.logo {
  background: #ed1b3a;
}

body.dark .page .item.logo .content {
  color: #fff;
}

body.dark .page .item.image {
  background: #f8fafc;
}

body.dark .page .item.photoPlaceholder {
  background:
    linear-gradient(135deg, rgba(220, 220, 220, 0.9), rgba(245, 245, 245, 0.95)),
    repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(0, 0, 0, 0.05) 12px, rgba(0, 0, 0, 0.05) 24px);
}

.badge {
  position: absolute;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  pointer-events: none;
  padding: 1px 2px;
  background: transparent;
}

.badge-top-left {
  top: 2px;
  left: 3px;
}

.badge-top-center {
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.badge-top-right {
  top: 2px;
  right: 3px;
}

.badge-middle-left {
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
}

.badge-middle-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.badge-middle-right {
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
}

.badge-bottom-left {
  bottom: 2px;
  left: 3px;
}

.badge-bottom-center {
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.badge-bottom-right {
  right: 3px;
  bottom: 2px;
}

.content {
  width: 100%;
  height: 100%;
  padding: 18px 6px 6px;
  font-size: 12px;
  line-height: 1.35;
  outline: none;
  overflow: hidden;
  cursor: text;
  white-space: pre-line;
  color: inherit;
  user-select: text;
}

.item.number-top-left .content,
.item.number-top-center .content,
.item.number-top-right .content {
  padding-top: 18px;
}

.item.number-bottom-left .content,
.item.number-bottom-center .content,
.item.number-bottom-right .content {
  padding-bottom: 18px;
}

.item.image.number-top-left .content,
.item.image.number-top-center .content,
.item.image.number-top-right .content,
.item.image.number-middle-left .content,
.item.image.number-middle-center .content,
.item.image.number-middle-right .content,
.item.image.number-bottom-left .content,
.item.image.number-bottom-center .content,
.item.image.number-bottom-right .content {
  padding: 18px 0 0;
}



.header .content,
.footer .content {
  padding-top: 8px;
  font-weight: 700;
}

.move,
.resize {
  position: absolute;
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  display: none;
  z-index: 2;
}

.move {
  right: 0;
  top: 0;
  cursor: move;
}

.move::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
}

.resize {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}

.item:hover .move,
.item.selected .move,
.item:hover .resize,
.item.selected .resize {
  display: block;
}

.mappingPanel {
  background: var(--panel);
  padding: 28px;
  overflow: auto;
}

.workspace:not(.mapping-mode) .mappingPanel {
  display: none;
}

.workspace.mapping-mode .canvasWrap {
  display: none;
}

.workspace.admin-mode .canvasWrap,
.workspace.admin-mode .mappingPanel {
  display: none;
}

.mappingHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mappingHead > div:first-child {
  display: grid;
  gap: 3px;
}

.mappingActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tableWrap {
  overflow: auto;
  border: 1px solid var(--line);
  max-height: calc(100vh - 170px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  min-width: 90px;
}

th:first-child,
td:first-child {
  min-width: 48px;
  text-align: center;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--table-head-bg);
  z-index: 1;
}

td[contenteditable="true"] {
  background: var(--input-bg);
}

.mappingCellInput {
  width: 100%;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 6px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
}

.mappingPanel:not(.editing) tbody td[data-field] {
  cursor: pointer;
}

.mappingPanel.editing #editMappingTable {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.page:not(.show-numbers) .badge {
  display: none;
}

.page:not(.show-borders) .item {
  border-color: transparent;
}

#printArea {
  display: none;
}

#printArea .page {
  --page-bg: #ffffff;
  --page-ink: #17202a;
  --grid: rgba(35, 48, 64, 0.12);
  background: #fff;
  color: #17202a;
}

#printArea .page .content {
  color: inherit;
}

#printArea .page .item.note .content {
  color: #f00000;
}

#printArea .page .item.logo .content {
  color: #fff;
}


/* Admin Page Styles */
.adminPage {
  min-width: 900px;
  padding: 28px;
  overflow: auto;
  background: var(--panel);
}

.workspace:not(.admin-mode) .adminPage {
  display: none;
}

.adminPageCard {
  width: min(1100px, 100%);
  display: grid;
  gap: 14px;
  margin: 0 auto;
  background: var(--panel);
  color: var(--ink);
}

.adminStats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px;
  background: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.statCard {
  display: grid;
  gap: 4px;
  text-align: center;
}

.statValue {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.statLabel {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.adminSection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sectionHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.sectionHead h2 {
  font-size: 14px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sectionActions {
  display: flex;
  gap: 8px;
}

button.danger {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

button.danger:hover {
  filter: brightness(1.1);
  border-color: var(--accent-2);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover {
  filter: brightness(1.1);
  border-color: var(--accent);
}

#loginLogTable tbody tr td:last-child span {
  font-weight: 600;
}

#loginLogTable .success {
  color: #16a34a;
}

#loginLogTable .failed {
  color: #ef4444;
}

/* Modal improvements */
.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 15, 22, 0.78);
}

.modalOverlay[hidden] {
  display: none;
}

#resetPasswordModal .modalCard,
#unlockUserModal .modalCard {
  width: min(420px, 100%);
}

#resetPasswordModal .modalHead span,
#unlockUserModal .modalHead span {
  color: var(--muted);
  font-size: 12px;
}

.infoModal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.helpModal {
  width: min(860px, 100%);
}

.aboutList {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 18px;
  margin: 0;
}

.aboutList dt {
  color: var(--muted);
}

.aboutList dd {
  margin: 0;
  font-weight: 700;
}

.aboutList a {
  color: #0f62d0;
}

body.dark .aboutList a {
  color: #8ab4ff;
}

.helpContent {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.helpContent h3 {
  margin: 12px 0 0;
  font-size: 14px;
}

.helpContent p,
.helpContent ul {
  margin: 0;
}

.helpContent ul {
  padding-left: 20px;
}

#forcePasswordForm,
#resetPasswordForm,
#unlockUserForm {
  display: grid;
  gap: 10px;
}

#forcePasswordForm label,
#resetPasswordForm label,
#unlockUserForm label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

#forcePasswordForm input,
#resetPasswordForm input {
  min-height: 34px;
  border: 1px solid #c7d0da;
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--input-bg);
  color: var(--ink);
}

#unlockUserForm p {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}


@media (max-width: 960px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
  }

  .workspace {
    height: auto;
  }

  .adminForm {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: 794px 1123px;
    margin: 0;
  }

  @page landscapePage {
    size: 1123px 794px;
    margin: 0;
  }

  html,
  body {
    display: block;
    background: #fff;
    width: auto;
    height: auto;
    margin: 0 !important;
  }

  .sidebar,
  .topbar,
  .mappingPanel,
  .canvasWrap,
  .infoDrawerShell,
  .drawerToggle,
  .authOverlay,
  .adminPage {
    display: none;
  }

  .workspace,
  #printArea {
    display: block;
    width: auto;
    height: auto;
    overflow: visible;
    padding: 0;
    min-width: 0;
  }

  #printArea .page {
    --page-bg: #ffffff;
    --page-ink: #17202a;
    --grid: rgba(35, 48, 64, 0.12);
    page: auto;
    position: relative;
    width: 794px;
    height: 1123px;
    background: #fff;
    color: #17202a;
    box-shadow: none;
    overflow: hidden;
    break-after: page;
    page-break-after: always;
  }

  #printArea .page.landscape {
    width: 1123px;
    height: 794px;
    page: landscapePage;
  }

  #printArea .cellColors {
    display: block;
    z-index: 1;
  }

  #printArea .coloredCell {
    background: transparent;
    box-sizing: border-box;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  #printArea .grid {
    inset: 32px;
    background-size: var(--grid-size, 18px) var(--grid-size, 18px);
    z-index: 0;
  }

  #printArea .items {
    z-index: 2;
  }

  #printArea .page .content {
    color: inherit;
  }

  #printArea .page .item {
    background: rgba(255, 255, 255, 0.92);
  }

  #printArea .page .item.title,
  #printArea .page .item.footerText,
  #printArea .page .item.note,
  #printArea .page .item.sectionTitle,
  #printArea .page .item.tableText,
  #printArea .page .item.processStrip {
    background: transparent;
  }

  #printArea .page .item.logo {
    background: #ed1b3a;
  }

  #printArea .page .item.photoPlaceholder {
    background:
      linear-gradient(135deg, rgba(220, 220, 220, 0.9), rgba(245, 245, 245, 0.95)),
      repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(0, 0, 0, 0.05) 12px, rgba(0, 0, 0, 0.05) 24px);
  }

  #printArea .page .item.note .content {
    color: #f00000;
  }

  #printArea .page .item.logo .content {
    color: #fff;
  }

  #printArea .printMapping {
    page: auto;
    width: 794px;
    min-height: 1123px;
    padding: 42px;
    background: #fff;
    break-after: page;
    page-break-after: always;
  }

  #printArea .printMapping h1 {
    font-size: 16px;
    margin: 0 0 16px;
  }

  .move,
  .resize {
    display: none;
  }
}
