.mts-admin {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    color: #2b2b2b;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    padding: 8px 16px 24px 0;
}

.mts-admin *,
.mts-admin *::before,
.mts-admin *::after {
    box-sizing: border-box;
}

.mts-admin h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
}

.mts-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.mts-toolbar-spacer {
    flex: 1 1 auto;
}

.mts-card {
    background: #fff;
    border: 1px solid #c5d4e8;
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: visible;
}

.mts-card-header {
    background: #2d6aa0;
    color: #fff;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px 4px 0 0;
}

.mts-card-body {
    padding: 12px;
}

.mts-hint {
    color: #5a5a5a;
    font-size: 12px;
    margin: 0 0 8px;
}

.mts-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.mts-inline-form .mts-field {
    margin-bottom: 0;
}

.mts-btn-row {
    display: flex;
    gap: 8px;
    align-items: center;
    height: 34px;
}

.mts-btn-row .mts-btn {
    height: 34px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mts-toolbar-btns label {
    visibility: hidden;
}

.mts-inline-form .mts-field > input[type="text"],
.mts-inline-form .mts-field > input[type="email"],
.mts-inline-form .mts-field > input[type="number"] {
    height: 34px;
}

.mts-inline-form .mts-btn,
.mts-toolbar > .mts-btn {
    height: 34px;
    margin: 0;
    line-height: 20px;
}

.mts-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    margin-bottom: 10px;
}

.mts-field label {
    font-weight: 600;
    font-size: 12px;
}

.mts-field input[type="text"],
.mts-field input[type="password"],
.mts-field input[type="email"],
.mts-field input[type="number"],
.mts-field select,
.mts-form input[type="text"],
.mts-form input[type="password"],
.mts-form input[type="email"],
.mts-form input[type="number"],
.mts-form select {
    border: 1px solid #b7c4d4;
    border-radius: 3px;
    padding: 6px 8px;
    font: inherit;
    width: 100%;
    display: block;
    max-width: 100%;
    margin: 0;
    background: #fff;
}

.mts-field input[type="number"] {
    width: 90px;
}

.mts-input-with-btn {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mts-input-with-btn input {
    flex: 1 1 auto;
    width: auto;
}

.mts-btn {
    display: inline-block;
    border: 1px solid #2d6aa0;
    background: #2d6aa0;
    color: #fff;
    border-radius: 3px;
    padding: 6px 12px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.mts-btn:hover {
    background: #245887;
    color: #fff;
}

.mts-btn-secondary {
    background: #fff;
    color: #2d6aa0;
}

.mts-btn-secondary:hover {
    background: #eef4fa;
    color: #2d6aa0;
}

.mts-btn-danger {
    background: #a33;
    border-color: #a33;
}

.mts-btn-danger:hover {
    background: #822;
}

.mts-btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

.mts-alert {
    padding: 8px 12px;
    border-radius: 3px;
    margin-bottom: 12px;
}

.mts-alert-ok {
    background: #e7f6e7;
    border: 1px solid #9ccc9c;
}

.mts-alert-error {
    background: #fdecec;
    border: 1px solid #e0a0a0;
}

.mts-table-wrap {
    width: 100%;
    overflow: visible;
}

.mts-table {
    width: 100%;
    border-collapse: collapse;
}

.mts-table th,
.mts-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #dce4ee;
    vertical-align: middle;
}

.mts-table .col-email,
.mts-table .mts-trunc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.mts-table th {
    background: #eef4fa;
    font-weight: 600;
    font-size: 12px;
}

.mts-table tbody tr:hover {
    background: #f6f9fc;
}

.mts-table .col-name {
    white-space: nowrap;
}

.mts-table .col-status {
    white-space: normal;
}

.mts-table .col-actions {
    width: 1%;
    white-space: nowrap;
    overflow: visible;
}

.mts-table .col-actions form {
    display: inline;
}

.mts-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    background: #dce8f4;
    color: #1f4e79;
}

.mts-badge-admin {
    background: #2d6aa0;
    color: #fff;
}

.mts-badge-warn {
    background: #f3d27a;
    color: #5a4200;
}

.mts-chip {
    display: inline-block;
    margin: 0 4px 2px 0;
    padding: 1px 6px;
    border-radius: 3px;
    background: #eee;
    font-size: 11px;
}

.mts-chip-alert {
    background: #f4d4d4;
}

.mts-empty {
    padding: 16px;
    color: #666;
}

.mts-child {
    display: none;
    background: #f8fbfe;
}

.mts-child.is-open {
    display: table-row;
}

.mts-child td {
    padding: 10px 12px 14px 40px;
    border-bottom: 1px solid #dce4ee;
}

.mts-child .mts-table {
    margin: 0;
    background: #fff;
}

.mts-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.mts-modal,
.mts-modal *,
.mts-modal *::before,
.mts-modal *::after {
    box-sizing: border-box;
}

.mts-modal.is-open {
    display: block;
}

.mts-modal-backdrop {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
}

.mts-modal-dialog {
    position: relative;
    z-index: 1;
    width: calc(100% - 48px);
    max-width: 920px;
    max-height: 92%;
    overflow: auto;
    margin: 24px auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.mts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #2d6aa0;
    color: #fff;
    padding: 10px 12px;
    font-weight: 600;
}

.mts-modal-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.mts-form {
    padding: 16px 20px 20px;
}

/* SiteV2 setzt global input { width: 300px } und lässt Selects unbegrenzt.
   Stammdaten daher fest 50/50, Controls immer 100% der Zelle. */
.mts-stammdaten {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.mts-stammdaten .mts-field {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    padding: 0 10px;
    margin: 0 0 12px;
    min-width: 0;
}

.mts-stammdaten .mts-field > input,
.mts-stammdaten .mts-field > select {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    height: 34px;
    margin: 0 !important;
    box-sizing: border-box;
    font-size: 13px;
}

.mts-stammdaten .mts-btn {
    width: auto !important;
    align-self: flex-start;
    margin-top: 6px;
}

.mts-form-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
}

.mts-form-row .mts-field {
    flex: 1 1 0;
    min-width: 0;
}

.mts-form-section {
    font-weight: 600;
    font-size: 14px;
    margin: 16px 0 10px;
    padding-top: 12px;
    border-top: 1px solid #e3eaf2;
}

.mts-option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mts-option {
    border: 1px solid #dce4ee;
    border-radius: 4px;
    padding: 10px 12px;
    background: #f8fbfe;
}

.mts-option label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 600;
    margin: 0;
}

.mts-option label input {
    width: auto;
    margin-top: 2px;
    flex: 0 0 auto;
}

.mts-option .mts-hint {
    margin: 4px 0 0 22px;
}

.mts-form-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.mts-actions-left {
    margin-right: auto;
}

.mts-help {
    color: #4a4a4a;
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 12px;
    max-width: 72em;
}

.mts-auth,
.mts-auth *,
.mts-auth *::before,
.mts-auth *::after {
    box-sizing: border-box;
}

.mts-auth {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    color: #2b2b2b;
    max-width: 520px;
}

.mts-auth h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px;
}

.mts-auth .mts-field input[type="text"],
.mts-auth .mts-field input[type="password"],
.mts-auth .mts-field input[type="email"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    height: 34px;
    font-size: 13px;
}

.mts-pw-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mts-pw-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.mts-check {
    list-style: none;
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px solid #dce4ee;
    border-radius: 4px;
    background: #f8fbfe;
}

.mts-check li {
    margin: 4px 0;
    color: #666;
}

.mts-check li.is-ok {
    color: #1b7a3d;
}

.mts-check li.is-ok:before {
    content: "✓ ";
}

.mts-check li.is-bad {
    color: #a33;
}

.mts-repeat-msg {
    font-size: 12px;
    min-height: 16px;
}

.mts-repeat-msg.ok {
    color: #1b7a3d;
}

.mts-repeat-msg.err {
    color: #a33;
}

.mts-text-danger {
    color: #a33;
    font-size: 12px;
}

.mts-auth {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    color: #2b2b2b;
    max-width: 520px;
}

.mts-auth *,
.mts-auth *::before,
.mts-auth *::after {
    box-sizing: border-box;
}

.mts-auth h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px;
}

.mts-auth .mts-field {
    margin-bottom: 12px;
}

.mts-auth .mts-field input[type="text"],
.mts-auth .mts-field input[type="password"],
.mts-auth .mts-field input[type="email"] {
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    font-size: 13px;
}

.mts-pw-toggle {
    width: auto !important;
    align-self: flex-start;
    margin-top: 6px;
}

.mts-checklist {
    list-style: none;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #dce4ee;
    border-radius: 4px;
    background: #f8fbfe;
}

.mts-checklist li {
    margin: 0 0 4px;
    padding-left: 18px;
    position: relative;
    color: #5a5a5a;
}

.mts-checklist li::before {
    content: "–";
    position: absolute;
    left: 0;
}

.mts-checklist li.is-ok {
    color: #1b6b2a;
}

.mts-checklist li.is-ok::before {
    content: "✓";
}

.mts-checklist li.is-bad {
    color: #a33;
}

.mts-repeat-msg {
    font-size: 12px;
    margin: 4px 0 0;
}

.mts-repeat-msg.ok {
    color: #1b6b2a;
}

.mts-repeat-msg.err {
    color: #a33;
}

.mts-auth .text-danger,
.mts-auth .field-validation-error {
    color: #a33;
    display: block;
    margin-top: 4px;
}

.mts-passkeys {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #c5d4e8;
}

.mts-passkeys h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
}

.mts-passkey-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.mts-passkey-list li {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.mts-passkeys .mts-field {
    margin-bottom: 12px;
}

.mts-admin.mts-picker {
    padding: 8px;
}

.mts-admin.mts-picker .mts-card {
    margin-bottom: 0;
}

.mts-admin.mts-picker .mts-table tbody tr {
    cursor: pointer;
}

.mts-admin.mts-picker .mts-table tbody tr:hover {
    background: #eef5fb;
}
