/* ── Admin dashboard ───────────────────────────────────────────────────── */

.admin-toolbar {
  justify-content: space-between;
}

.admin-toolbar .lang-switch {
  margin-left: auto;
}

.save-status {
  color: var(--cream-dim);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.save-status.dirty {
  color: var(--gold-soft);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 5fr) minmax(360px, 7fr);
  gap: 16px;
  padding: 16px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.editor-panel,
.preview-panel {
  background: var(--paper);
  border: 0.4mm solid var(--hairline);
  border-radius: 2mm;
  padding: 14px;
  min-width: 0;
}

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

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool-btn.small {
  font-size: 9px;
  letter-spacing: 1px;
  padding: 6px 10px;
}

.preview-actions .tool-btn.small {
  color: var(--navy-deep);
  background: #ffffff;
  border: 1px solid rgba(29, 53, 99, 0.32);
}

.preview-actions .tool-btn.small:hover,
.preview-actions .tool-btn.small:focus-visible {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: var(--cream);
}

.panel-head h2,
.security-panel h2 {
  font-size: 9pt;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--navy);
}

#editor {
  width: 100%;
  min-height: 420px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: 1mm;
  padding: 10px;
  resize: vertical;
}

.editor-error {
  min-height: 14px;
  color: #b3261e;
  font-size: 11px;
  margin-top: 6px;
  white-space: pre-wrap;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tab {
  font: inherit;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--hairline);
  border-radius: 2mm;
  padding: 6px 12px;
  cursor: pointer;
  background: transparent;
  color: var(--navy);
}

.tab.active {
  background: var(--navy-deep);
  color: var(--cream);
  border-color: var(--navy-deep);
}

.security-panel {
  border-top: 0.3mm solid var(--hairline);
  margin-top: 12px;
  padding-top: 12px;
}

.hint {
  font-size: 9pt;
  color: var(--muted);
}

.hint code {
  font-size: 8.5pt;
}

.token-row,
.password-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.token-row input,
.password-form input {
  flex: 1 1 200px;
  font: inherit;
  font-size: 11px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 1mm;
  color: var(--ink);
}

.preview-panel {
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.preview-panel .panel-head {
  flex: 0 0 auto;
}

.preview-panel .preview {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.preview {
  overflow: visible;
  min-height: 120px;
}

.preview .sheet-wrap {
  margin: 0 auto;
}

/* Portfolio (text) preview */
.portfolio-preview {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
}

/* Print: only preview sheet */
@media print {
  .editor-panel,
  .admin-toolbar {
    display: none !important;
  }
  .admin-grid {
    display: block;
    padding: 0;
  }
  .preview-panel {
    position: static;
    border: none;
  }
}

/* Buttons inside the light panels need dark-on-light styling (the default
   .tool-btn is designed for the dark toolbar). */
.editor-actions .tool-btn,
.token-row .tool-btn,
.password-form .tool-btn {
  color: var(--navy-deep);
  background: #ffffff;
  border: 1px solid rgba(29, 53, 99, 0.32);
}

.editor-actions .tool-btn:hover,
.editor-actions .tool-btn:focus-visible,
.token-row .tool-btn:hover,
.token-row .tool-btn:focus-visible,
.password-form .tool-btn:hover,
.password-form .tool-btn:focus-visible {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: var(--cream);
}

#editor {
  tab-size: 2;
}

.ats-hint {
  margin: 0 0 10px;
  font-size: 8.5pt;
}
