.tmi-signature-app {
  max-width: 1120px;
  margin: 34px auto;
  padding: 0;
  background: #fff;
  border: 1px solid #d9e0e8;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(23,32,51,.10);
  overflow: hidden;
  color: #172033;
}
.tmi-signing-hero {
  padding: 34px 38px;
  background: linear-gradient(135deg, #172033 0%, #1f4e79 58%, #b8924b 140%);
  color: #fff;
}
.tmi-signing-hero span {
  display: block;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 800;
  opacity: .78;
}
.tmi-signing-hero h2 {
  margin: 8px 0 12px;
  font-size: 38px;
  line-height: 1.05;
  color: #fff;
}
.tmi-signing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tmi-signing-meta b {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 13px;
}
.tmi-review-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 16px 24px;
  background: #f5f7fa;
  border-bottom: 1px solid #d9e0e8;
}
.tmi-review-toolbar button,
.tmi-submit-signature {
  appearance: none;
  border: 0;
  background: #172033;
  color: #fff;
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}
.tmi-signature-app input[type="text"] {
  width: 100%;
  max-width: 620px;
  padding: 12px 14px;
  border: 1px solid #cfd7e2;
  border-radius: 12px;
  margin-top: 6px;
}
.tmi-signature-panel {
  margin: 22px 24px 28px;
  padding: 24px;
  border: 1px solid #d9e0e8;
  border-radius: 20px;
  background: #fff;
}
.tmi-signature-panel h3 {
  margin: 0 0 8px;
  font-size: 22px;
}
.tmi-checkbox-line {
  display: inline-flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0;
}
.tmi-signature-pad canvas {
  display: block;
  width: 100%;
  max-width: 760px;
  height: 240px;
  background: #fff;
  border: 2px solid #172033;
  border-radius: 16px;
  touch-action: none;
  margin: 12px 0 10px;
}
.tmi-signature-pad .button,
.tmi-signature-pad button {
  border: 1px solid #cfd7e2;
  background: #fff;
  color: #172033;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.tmi-success {
  padding: 14px 18px;
  border-left: 5px solid #198754;
  background: #d1e7dd;
  margin: 18px 24px;
  border-radius: 12px;
}
.tmi-packet-details {
  margin: 0;
  padding: 0;
  background: #fff;
  border: 0;
}
.tmi-packet-details summary {
  cursor: pointer;
  font-weight: 800;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid #d9e0e8;
}
.tmi-saved-signature {
  max-width: 460px;
  border: 1px solid #d9e0e8;
  background: #fff;
  border-radius: 12px;
  margin: 0 24px 24px;
}
@media (max-width: 760px) {
  .tmi-signature-app { margin: 16px; border-radius: 18px; }
  .tmi-signing-hero { padding: 24px; }
  .tmi-signing-hero h2 { font-size: 30px; }
  .tmi-review-toolbar { flex-direction: column; align-items: flex-start; }
}
@media print {
  .tmi-signature-form, .tmi-packet-details summary, .tmi-signing-hero, .tmi-review-toolbar, .tmi-success { display: none !important; }
  .tmi-signature-app { box-shadow: none; border: 0; padding: 0; max-width: none; margin: 0; border-radius: 0; }
  .tmi-packet-details { display: block !important; }
}

.tmi-empty-signing-page .tmi-help-panel {
  padding: 28px;
}
.tmi-help-panel h3 {
  margin-top: 0;
}
.tmi-help-steps {
  margin: 16px 0 18px 22px;
}
.tmi-help-steps li {
  margin: 8px 0;
}
.tmi-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.tmi-public-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #172033;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 800;
}
.tmi-public-button.secondary {
  background: #f5f7fa;
  color: #172033 !important;
  border: 1px solid #cfd7e2;
}
.tmi-latest-link {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #d9e0e8;
  border-radius: 16px;
  background: #f8fafc;
}
.tmi-latest-link h4 {
  margin: 0 0 8px;
}
.tmi-latest-link input[type="text"] {
  width: 100%;
  max-width: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.tmi-muted-note {
  color: #5f6b7a;
  font-size: 14px;
}

.tmi-upload-cta {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 14px 0 6px;
  padding: 16px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #173f6b, #1f5f97) !important;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(23,63,107,.22);
  border: 1px solid rgba(255,255,255,.18);
}
.tmi-upload-cta span { display: block; color: #fff; font-size: 15px; }
.tmi-upload-cta em { display: block; color: #fff; opacity: .88; font-style: normal; font-size: 11px; font-weight: 700; margin-top: 3px; }
.tmi-upload-cta:after {
  content: "Open Upload Form →";
  white-space: nowrap;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tmi-upload-callout { background: linear-gradient(180deg, #f7fbff, #fff) !important; }
@media (max-width: 700px) { .tmi-upload-cta { flex-direction: column; align-items: flex-start; } }

/* Front-end staff webapp */
.tmi-staff-app {
  max-width: 1180px;
  margin: 34px auto;
  color: #172033;
  font-family: Inter, Arial, Helvetica, sans-serif;
}
.tmi-staff-login,
.tmi-staff-card,
.tmi-staff-success,
.tmi-staff-alert,
.tmi-staff-stats > div {
  background: #fff;
  border: 1px solid #d9e0e8;
  border-radius: 22px;
  box-shadow: 0 18px 54px rgba(23,32,51,.08);
}
.tmi-staff-login {
  max-width: 460px;
  margin: 60px auto;
  padding: 34px;
}
.tmi-staff-login h2,
.tmi-staff-hero h2,
.tmi-staff-card h3 {
  margin-top: 0;
  letter-spacing: -0.03em;
}
.tmi-staff-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  color: #fff;
  padding: 34px 38px;
  border-radius: 28px;
  background: linear-gradient(135deg, #172033 0%, #1f4e79 62%, #b8924b 145%);
  box-shadow: 0 28px 70px rgba(23,32,51,.14);
}
.tmi-staff-hero span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .75;
}
.tmi-staff-hero h2 {
  color: #fff;
  font-size: 36px;
  margin-bottom: 8px;
}
.tmi-staff-hero p { margin: 0; max-width: 680px; }
.tmi-staff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.tmi-staff-card { padding: 24px; }
.tmi-staff-card label,
.tmi-staff-login label {
  display: block;
  font-weight: 800;
  font-size: 13px;
  margin: 14px 0;
}
.tmi-staff-card input,
.tmi-staff-card select,
.tmi-staff-card textarea,
.tmi-staff-login input,
.tmi-staff-success input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #cfd7e2;
  border-radius: 12px;
  margin-top: 6px;
  font: inherit;
}
.tmi-staff-card button,
.tmi-staff-login button,
.tmi-staff-hero button,
.tmi-staff-success a {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #172033;
  color: #fff !important;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tmi-staff-hero button { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); }
.tmi-staff-two,
.tmi-staff-keygrid,
.tmi-staff-stats {
  display: grid;
  gap: 10px;
}
.tmi-staff-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tmi-staff-keygrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tmi-staff-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}
.tmi-staff-stats > div { padding: 18px; }
.tmi-staff-stats strong { display: block; font-size: 34px; line-height: 1; }
.tmi-staff-stats span { color: #667085; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.tmi-staff-success { padding: 20px; margin-top: 18px; border-left: 5px solid #198754; }
.tmi-staff-alert { padding: 14px 16px; margin: 14px 0; border-left: 5px solid #b42318; background: #fff7f5; }
.tmi-staff-card table { width: 100%; border-collapse: collapse; }
.tmi-staff-card th,
.tmi-staff-card td { border-bottom: 1px solid #d9e0e8; padding: 9px 6px; text-align: left; font-size: 13px; }
@media (max-width: 900px) {
  .tmi-staff-grid,
  .tmi-staff-stats { grid-template-columns: 1fr; }
  .tmi-staff-keygrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tmi-staff-hero { flex-direction: column; align-items: flex-start; }
}

/* v4.2 app-only shell: bypass theme chrome and present the portal as a standalone webapp. */
html.tmi-app-shell-html,
html.tmi-app-shell-html body.tmi-app-shell-body {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100%;
  background: #eef2f7;
}
body.tmi-app-shell-body {
  color: #172033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}
html.tmi-app-shell-html,
html.tmi-app-shell-html body.tmi-app-shell-body.admin-bar {
  margin-top: 0 !important;
}
body.tmi-app-shell-body #wpadminbar {
  display: none !important;
}
.tmi-app-shell-root {
  min-height: 100vh;
  width: 100%;
  background:
    radial-gradient(circle at top left, rgba(184,146,75,.13), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}
body.tmi-app-shell-body .tmi-staff-app,
body.tmi-app-shell-body .tmi-signature-app {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background: transparent;
}
body.tmi-app-shell-body .tmi-signature-app {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.tmi-app-shell-body .tmi-staff-login,
body.tmi-app-shell-body .tmi-staff-hero,
body.tmi-app-shell-body .tmi-staff-stats,
body.tmi-app-shell-body .tmi-staff-grid,
body.tmi-app-shell-body .tmi-staff-success,
body.tmi-app-shell-body .tmi-staff-alert,
body.tmi-app-shell-body .tmi-empty-signing-page,
body.tmi-app-shell-body .tmi-signing-hero,
body.tmi-app-shell-body .tmi-review-toolbar,
body.tmi-app-shell-body .tmi-packet-details,
body.tmi-app-shell-body .tmi-signature-panel {
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
}
body.tmi-app-shell-body .tmi-staff-hero,
body.tmi-app-shell-body .tmi-signing-hero {
  border-radius: 28px;
}
body.tmi-app-shell-body .tmi-review-toolbar,
body.tmi-app-shell-body .tmi-packet-details,
body.tmi-app-shell-body .tmi-signature-panel {
  box-sizing: border-box;
}
body.tmi-app-shell-body .tmi-packet-details,
body.tmi-app-shell-body .tmi-signature-panel,
body.tmi-app-shell-body .tmi-review-toolbar {
  border-left: 1px solid #d9e0e8;
  border-right: 1px solid #d9e0e8;
}
body.tmi-app-shell-body .tmi-signature-panel,
body.tmi-app-shell-body .tmi-packet-details {
  background: #fff;
}
@media (max-width: 760px) {
  body.tmi-app-shell-body .tmi-staff-app,
  body.tmi-app-shell-body .tmi-signature-app {
    padding: 12px;
  }
  body.tmi-app-shell-body .tmi-staff-hero,
  body.tmi-app-shell-body .tmi-signing-hero {
    border-radius: 20px;
  }
}
@media print {
  html.tmi-app-shell-html,
  body.tmi-app-shell-body,
  .tmi-app-shell-root {
    background: #fff !important;
  }
  body.tmi-app-shell-body .tmi-staff-app,
  body.tmi-app-shell-body .tmi-signature-app {
    min-height: auto;
    padding: 0;
  }
}

/* v4.10: keep open and email actions visible together in the staff portal. */
.tmi-staff-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.tmi-staff-action-row form {
  margin: 0;
}
.tmi-staff-link-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #172033;
  color: #fff !important;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.tmi-staff-link-button.danger {
  background: #b42318;
}

.tmi-signature-thumb-link{display:inline-block;line-height:0;text-decoration:none}.tmi-signature-thumb{width:150px;max-width:150px;height:62px;object-fit:contain;background:#fff;border:1px solid #d0d7de;border-radius:2px;padding:5px;box-shadow:0 1px 2px rgba(16,24,40,.06)}.tmi-signature-thumb-meta{font-size:11px;line-height:1.25;color:#667085;margin-top:4px}

/* v4.21 front-end database portal */
.tmi-db-app .tmi-staff-hero { margin-bottom: 18px; }
.tmi-db-nav {
  max-width: 1320px;
  margin: 18px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tmi-db-nav a,
.tmi-db-toplink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d9e0e8;
  color: #172033 !important;
  text-decoration: none !important;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(23,32,51,.05);
}
.tmi-db-section {
  max-width: 1320px;
  margin: 18px auto;
}
.tmi-db-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.tmi-db-section-head h3 { margin: 0 0 4px; }
.tmi-db-section-head p { margin: 0; color: #667085; font-weight: 700; }
.tmi-db-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d9e0e8;
  border-radius: 16px;
  background: #fff;
}
.tmi-db-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
.tmi-db-table th,
.tmi-db-table td {
  padding: 10px 9px;
  border-bottom: 1px solid #e5eaf0;
  vertical-align: top;
  text-align: left;
  font-size: 12.5px;
}
.tmi-db-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #344054;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 11px;
}
.tmi-db-table tr.is-done td {
  background: #f6fbf8;
  color: #475467;
}
.tmi-db-done-form { margin: 0; min-width: 112px; }
.tmi-db-done-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  font-size: 12px;
}
.tmi-db-done-form .tmi-db-open { background: #172033; }
.tmi-db-done-form .tmi-db-done { background: #198754; }
.tmi-db-done-form small {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: 10px;
  line-height: 1.2;
}
.tmi-db-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef4ff;
  color: #173f6b;
  font-weight: 900;
}
.tmi-db-signature {
  width: 150px;
  max-width: 150px;
  height: 62px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  padding: 5px;
}
.tmi-db-muted { color: #98a2b3; font-style: italic; }
.tmi-db-app .tmi-staff-link-button { margin: 2px 2px 2px 0; }
@media (max-width: 760px) {
  .tmi-db-section-head { flex-direction: column; }
  .tmi-db-table { min-width: 860px; }
}
