/* Shared visual layer for the remaining legacy views. All selectors are scoped. */
.mkd-shell .mkd-auth-page,
.mkd-shell .mkd-status-page,
.mkd-shell .mkd-admin-page {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #162820;
  -webkit-font-smoothing: antialiased;
}
.mkd-shell .mkd-auth-page *,
.mkd-shell .mkd-status-page *,
.mkd-shell .mkd-admin-page * { box-sizing: border-box; }
.mkd-shell .mkd-eyebrow {
  margin: 0 0 9px;
  color: #087562;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.mkd-shell .mkd-button,
.mkd-shell .mkd-auth-form input[type="submit"],
.mkd-shell .mkd-admin-page input[type="submit"],
.mkd-shell .mkd-admin-page input[type="button"] {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.mkd-shell .mkd-button--primary,
.mkd-shell .mkd-auth-form input[type="submit"],
.mkd-shell .mkd-admin-page input[type="submit"] { color: #fff; background: #10513f; border-color: #10513f; }
.mkd-shell .mkd-button--primary:hover,
.mkd-shell .mkd-auth-form input[type="submit"]:hover,
.mkd-shell .mkd-admin-page input[type="submit"]:hover { color: #fff; background: #0b3f31; border-color: #0b3f31; }
.mkd-shell .mkd-button--secondary,
.mkd-shell .mkd-admin-page input[type="button"] { color: #234c3e; background: #fff; border-color: #cfddd5; }
.mkd-shell .mkd-button--secondary:hover,
.mkd-shell .mkd-admin-page input[type="button"]:hover { color: #10513f; background: #f3f8f5; border-color: #9fc1b1; }

/* Authentication and system messages */
.mkd-legacy.full .content:has(.mkd-auth-page),
.mkd-legacy.full .content:has(.mkd-status-page) { width: 100%; padding-bottom: 0; overflow: visible; }
.mkd-shell .mkd-auth-page,
.mkd-shell .mkd-status-page {
  min-height: 560px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 20px 72px;
  background: linear-gradient(180deg, #f7faf8 0, #fff 62%);
}
.mkd-shell .mkd-auth-card,
.mkd-shell .mkd-status-card {
  width: min(440px, 100%);
  padding: 34px 36px 36px;
  background: #fff;
  border: 1px solid #dfe9e3;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(25, 67, 49, .09);
}
.mkd-shell .mkd-auth-card { text-align: left; }
.mkd-shell .mkd-auth-page p { text-align: left; text-indent: 0; }
.mkd-shell .mkd-auth-icon,
.mkd-shell .mkd-status-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: #087562;
  background: #ebf7f1;
  border-radius: 13px;
  font-size: 24px;
  font-weight: 750;
}
.mkd-shell .mkd-auth-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mkd-shell .mkd-auth-card h1,
.mkd-shell .mkd-status-card h1 { margin: 0; color: #132a21; font-size: clamp(28px, 4vw, 34px); font-weight: 720; line-height: 1.12; letter-spacing: -.035em; }
.mkd-shell .mkd-auth-lead,
.mkd-shell .mkd-status-card > p:not(.mkd-eyebrow) { margin: 12px 0 26px; color: #64756d; font-size: 15px; line-height: 1.55; }
.mkd-shell .mkd-auth-form {
  position: static;
  inset: auto;
  transform: none;
  float: none;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  text-align: left;
}
.mkd-shell .mkd-auth-form label,
.mkd-shell .mkd-query-form label { display: block; margin: 0 0 7px; color: #2d443a; font-size: 13px; font-weight: 650; }
.mkd-shell .mkd-auth-form input[type="text"],
.mkd-shell .mkd-auth-form input[type="password"] {
  width: 100%;
  height: 46px;
  margin: 0 0 17px;
  padding: 10px 13px;
  color: #162820;
  background: #fbfcfb;
  border: 1px solid #ccd9d2;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
}
.mkd-shell .mkd-auth-form input:focus { border-color: #16866b; box-shadow: 0 0 0 3px rgba(22, 134, 107, .12); }
.mkd-shell .mkd-auth-form input[type="submit"] { width: 100%; margin-top: 5px; }
.mkd-shell .mkd-status-card { text-align: center; }
.mkd-shell .mkd-status-card .mkd-status-icon { margin-inline: auto; }
.mkd-shell .mkd-status-card .mkd-eyebrow { text-align: center; }
.mkd-shell .mkd-status-card--error .mkd-status-icon { color: #b24c43; background: #fcefed; }
.mkd-shell .mkd-status-card--warning .mkd-status-icon { color: #9a6b13; background: #fff7df; }
.mkd-shell .mkd-system-message { margin: 2px 0 25px; color: #30443b; font-size: 17px; line-height: 1.6; }
.mkd-shell .mkd-system-message a { color: #087562; font-weight: 650; }

/* Admin and remaining generic database screens */
.mkd-shell .mkd-admin-page { width: min(1440px, 100%); margin: 0 auto; padding: 38px 0 22px; }
.mkd-shell .mkd-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.mkd-shell .mkd-page-heading h1 { margin: 0; color: #132a21; font-size: clamp(28px, 3vw, 38px); font-weight: 720; line-height: 1.1; letter-spacing: -.035em; }
.mkd-shell .mkd-page-heading p:not(.mkd-eyebrow) { margin: 9px 0 0; color: #6a7972; font-size: 14px; line-height: 1.5; }
.mkd-shell .mkd-page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.mkd-shell .mkd-table-card,
.mkd-shell .mkd-form-card,
.mkd-shell .mkd-settings-card,
.mkd-shell .mkd-action-card,
.mkd-shell .mkd-filter-card {
  background: #fff;
  border: 1px solid #dfe8e2;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(31, 65, 51, .055);
}
.mkd-shell .mkd-table-scroll { width: 100%; overflow-x: auto; border-radius: inherit; }
.mkd-shell .mkd-admin-page table.mkd-data-table { width: 100% !important; max-width: none; margin: 0; border-collapse: collapse; border: 0; background: transparent; font-family: inherit; }
.mkd-shell .mkd-admin-page table.mkd-data-table th { padding: 13px 14px; color: #53655c; background: #f4f8f6; border: 0; border-bottom: 1px solid #dfe8e2; font-size: 12px; font-weight: 700; line-height: 1.35; text-align: left; }
.mkd-shell .mkd-admin-page table.mkd-data-table td { padding: 13px 14px; color: #293d34; background: #fff; border: 0; border-bottom: 1px solid #edf1ef; font-size: 13px; line-height: 1.45; vertical-align: middle; }
.mkd-shell .mkd-admin-page table.mkd-data-table tr:last-child td { border-bottom: 0; }
.mkd-shell .mkd-admin-page table.mkd-data-table tr:hover td { background: #fafcfb; }
.mkd-shell .mkd-admin-page a { color: #087562; }
.mkd-shell .mkd-admin-page a.mkd-button--primary { color: #fff; }
.mkd-shell .mkd-admin-page a.mkd-button--secondary { color: #234c3e; }
.mkd-shell .mkd-admin-page input[type="text"],
.mkd-shell .mkd-admin-page input[type="email"],
.mkd-shell .mkd-admin-page input[type="password"],
.mkd-shell .mkd-admin-page input[type="number"],
.mkd-shell .mkd-admin-page input[type="file"],
.mkd-shell .mkd-admin-page select,
.mkd-shell .mkd-admin-page textarea {
  min-height: 39px;
  max-width: 100%;
  padding: 8px 10px;
  color: #1f352b;
  background: #fbfcfb;
  border: 1px solid #ccd9d2;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.mkd-shell .mkd-admin-page input:focus,
.mkd-shell .mkd-admin-page select:focus,
.mkd-shell .mkd-admin-page textarea:focus { border-color: #16866b; box-shadow: 0 0 0 3px rgba(22, 134, 107, .1); }
.mkd-shell .mkd-filter-card { margin: 0 0 18px; padding: 15px 18px; }
.mkd-shell .mkd-filter-card table { margin: 0; border: 0; }
.mkd-shell .mkd-filter-card td { padding: 6px 8px; border: 0; }
.mkd-shell .mkd-notice { margin-bottom: 18px; padding: 13px 16px; border-radius: 10px; font-size: 14px; }
.mkd-shell .mkd-notice--success { color: #176143; background: #ebf8f1; border: 1px solid #cce9da; }
.mkd-shell .mkd-form-card { padding: 24px; overflow-x: auto; }
.mkd-shell .mkd-form-card > table { width: 100%; border-collapse: collapse; }
.mkd-shell .mkd-form-card table table { width: 100%; border-collapse: separate; border-spacing: 0 11px; }
.mkd-shell .mkd-form-card td { padding: 4px 8px; border: 0; font-family: inherit; font-size: 13px; line-height: 1.4; }
.mkd-shell .mkd-form-card table table td:first-child { width: 220px; color: #506158; font-weight: 600; }
.mkd-shell .mkd-form-card table table input[type="text"],
.mkd-shell .mkd-form-card table table input[type="email"] { width: min(100%, 560px) !important; }
.mkd-shell .mkd-settings-card { margin-bottom: 20px; padding: 20px; }
.mkd-shell .mkd-settings-card h2 { margin: 0 0 14px; font-size: 19px; }
.mkd-shell .mkd-settings-grid > table { width: 100%; border-collapse: separate; border-spacing: 14px 0; }
.mkd-shell .mkd-settings-grid > table > tbody > tr > td { width: 50%; padding: 0; }
.mkd-shell .mkd-settings-grid .tdata { width: 100%; border: 1px solid #dfe8e2; border-radius: 14px; border-collapse: separate; border-spacing: 0; overflow: hidden; background: #fff; }
.mkd-shell .mkd-settings-grid .tdata th { padding: 14px; background: #f4f8f6; border: 0; border-bottom: 1px solid #dfe8e2; color: #314a3e; text-align: left; }
.mkd-shell .mkd-settings-grid .tdata td { padding: 10px 12px; border: 0; border-bottom: 1px solid #edf1ef; }
.mkd-shell .mkd-action-card { margin-top: 16px; padding: 16px; }
.mkd-shell .mkd-inline-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.mkd-shell .mkd-query-form { display: grid; gap: 12px; }
.mkd-shell .mkd-query-form textarea { width: 100%; min-height: 220px; resize: vertical; font-family: Consolas, monospace; }
.mkd-shell .mkd-query-form input[type="submit"] { justify-self: start; }

@media (max-width: 820px) {
  .mkd-shell .mkd-admin-page { padding-top: 26px; }
  .mkd-shell .mkd-page-heading { align-items: flex-start; flex-direction: column; }
  .mkd-shell .mkd-page-actions { justify-content: flex-start; }
  .mkd-shell .mkd-settings-grid > table,
  .mkd-shell .mkd-settings-grid > table > tbody,
  .mkd-shell .mkd-settings-grid > table > tbody > tr,
  .mkd-shell .mkd-settings-grid > table > tbody > tr > td { display: block; width: 100%; }
  .mkd-shell .mkd-settings-grid > table > tbody > tr > td + td { margin-top: 16px; }
  .mkd-shell .mkd-form-card > table > tbody > tr > td { display: block; width: 100%; }
}
@media (max-width: 560px) {
  .mkd-shell .mkd-auth-page, .mkd-shell .mkd-status-page { min-height: 500px; padding: 30px 14px 50px; }
  .mkd-shell .mkd-auth-card, .mkd-shell .mkd-status-card { padding: 26px 22px 28px; border-radius: 15px; }
  .mkd-shell .mkd-auth-icon, .mkd-shell .mkd-status-icon { margin-bottom: 19px; }
  .mkd-shell .mkd-button { width: 100%; }
  .mkd-shell .mkd-form-card { padding: 16px 12px; }
  .mkd-shell .mkd-form-card table table td { display: block; width: 100% !important; padding-inline: 0; }
  .mkd-shell .mkd-form-card table table tr { display: block; margin-bottom: 14px; }
  .mkd-shell .mkd-form-card table table input,
  .mkd-shell .mkd-form-card table table select { width: 100% !important; }
}
