body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f4f5f7;
    color: #1d2327;
    margin: 0;
    padding: 40px 20px;
}

.mpl-wrap {
    max-width: 720px;
    margin: 0 auto;
}

/* index.php only — the per-team dashboard needs room for the tabbed
   matches/images/debug layout below; login.php/audit.php stay at the
   base .mpl-wrap width above, since neither uses tabs. */
.mpl-wrap.-is-wide {
    max-width: 1920px;
}

.mpl-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 20px;
}

.mpl-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.mpl-field {
    margin-bottom: 14px;
}

.mpl-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.mpl-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.mpl-button {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 9px 16px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.mpl-button:hover {
    background: #135e96;
}

.mpl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mpl-header h1 {
    font-size: 20px;
    margin: 0;
}

.mpl-logout {
    color: #646970;
    font-size: 13px;
}

.mpl-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #dcdcde;
    flex-wrap: wrap;
}

.mpl-match:last-child {
    border-bottom: none;
}

.mpl-match-teams {
    font-weight: 600;
}

.mpl-match-meta {
    color: #646970;
    font-size: 13px;
}

.mpl-generate-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mpl-generate-buttons button {
    background: #f0f0f1;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
}

.mpl-generate-buttons button:hover {
    background: #dcdcde;
}

.mpl-empty {
    color: #646970;
}

/* index.php's matches/images/debug dashboard tabs — each .mpl-tab-panel
   replaces what used to be its own separate .mpl-card, so the tab strip
   sits flush with .mpl-card's own 24px padding via the negative margin. */
.mpl-tabs {
    display: flex;
    gap: 20px;
    margin: -24px -24px 20px;
    padding: 0 24px;
    border-bottom: 1px solid #dcdcde;
}

.mpl-tab-button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 0;
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    cursor: pointer;
}

.mpl-tab-button:hover {
    color: #1d2327;
}

.mpl-tab-button.-is-active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.mpl-tab-panel {
    display: none;
}

.mpl-tab-panel.-is-active {
    display: block;
}

.mpl-gallery-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #dcdcde;
}

.mpl-gallery-entry-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mpl-gallery-thumb {
    height: 50px;
    width: auto;
    display: block;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.mpl-thumb-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: zoom-in;
    line-height: 0;
}

.mpl-thumb-trigger .mpl-gallery-thumb {
    transition: opacity .15s;
}

.mpl-thumb-trigger:hover .mpl-gallery-thumb {
    opacity: .85;
}

/* Shared lightbox modal (index.php) — one instance, reused for every
   thumbnail's full-size image. */
.mpl-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(29, 35, 39, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    z-index: 100;
}

.mpl-lightbox[hidden] {
    display: none;
}

.mpl-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}

.mpl-lightbox-close {
    position: fixed;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
}

.mpl-gallery-entry:last-child {
    border-bottom: none;
}

.mpl-gallery-entry-actions {
    display: flex;
    gap: 6px;
}

.mpl-delete-button {
    background: #fcf0f1;
    color: #d63638;
    border: 1px solid #d63638;
    border-radius: 4px;
    padding: 9px 12px;
    font-size: 13px;
    cursor: pointer;
}

.mpl-delete-button:hover {
    background: #d63638;
    color: #fff;
}

#mpl-debug-log {
    max-height: 320px;
    overflow-y: auto;
    background: #1d2327;
    color: #c3c4c7;
    padding: 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.mpl-debug-entry {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #3c434a;
}

.mpl-debug-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* audit.php's team quick-pick list — a wrapped row of small pill links,
   one per team_id that currently has at least one generated entry. */
.mpl-team-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mpl-team-picker a {
    display: inline-block;
    background: #f0f0f1;
    border: 1px solid #8c8f94;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    text-decoration: none;
    color: #1d2327;
}

.mpl-team-picker a:hover,
.mpl-team-picker a.-is-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.mpl-team-form {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
}

.mpl-team-form input[type="number"] {
    width: 120px;
    padding: 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}

/* index.php's own banner when the current session is an admin-override
   view opened from audit.php (open-team.php), not a real per-team login. */
.mpl-admin-banner {
    background: #fcf9e8;
    border: 1px solid #dba617;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 0 0 20px;
    font-size: 13px;
}
