:root {
    --mgmt-bg: #ffffff;
    --mgmt-ink: #000000;
    --mgmt-muted: #666666;
    --mgmt-line: #d9d9d9;
    --mgmt-soft: #f5f5f5;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    background: var(--mgmt-bg);
    color: var(--mgmt-ink);
}

body {
    margin: 0;
    font-family: 'trjn_vundo', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.media-modal-open {
    overflow: hidden;
}

body.mgmt-login {
    display: grid;
    place-items: center;
    padding: 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: monospace, serif;
    font-size: 12px;
}

.shell {
    width: calc(100vw - 48px);
    margin: 0 24px;
    padding: 32px 0 72px;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--mgmt-ink);
    margin-bottom: 28px;
}

.nav h1 {
    margin: 0;
    font-size: 40px;
    line-height: 0.95;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.nav p,
.panel > p {
    margin: 10px 0 0;
    color: var(--mgmt-muted);
    font-size: 13px;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel > p {
    margin: 0 0 24px;
    letter-spacing: 0.06em;
}

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

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--mgmt-ink);
    border-radius: 0;
    background: var(--mgmt-ink);
    color: var(--mgmt-bg);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 120ms ease, color 120ms ease;
}

.panel button {
    width: 100%;
    min-height: 44px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.button.secondary {
    background: transparent;
    color: var(--mgmt-ink);
}

.button.danger,
button.danger {
    background: transparent;
    color: #b42318;
    border-color: #b42318;
}

.button:hover,
button:hover {
    background: transparent;
    color: var(--mgmt-ink);
}

.button.secondary:hover,
.button.danger:hover,
button.danger:hover {
    background: var(--mgmt-ink);
    color: var(--mgmt-bg);
}

.button.danger:hover,
button.danger:hover {
    background: #b42318;
    border-color: #b42318;
    color: #ffffff;
}

.card,
.panel {
    border: 1px solid var(--mgmt-ink);
    padding: 24px;
}

.panel {
    width: min(100%, 420px);
    padding: 28px;
}

.status,
.errors {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid var(--mgmt-ink);
    font-size: 13px;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status,
.panel .errors {
    background: var(--mgmt-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--mgmt-line);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--mgmt-line);
    padding: 12px 14px;
    background: #fff;
    cursor: pointer;
}

.checkbox-card input {
    width: auto;
    margin: 0;
    padding: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.required-status {
    color: var(--mgmt-muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    margin-left: 6px;
}

.field.is-valid > label,
.mgmt-section.is-valid > .mgmt-section-title {
    color: #157347;
}

.field.is-invalid > label,
.mgmt-section.is-invalid > .mgmt-section-title {
    color: #b42318;
}

.field.is-valid > .required-status,
.field.is-valid [data-required-status-label],
.mgmt-section.is-valid [data-required-status-label] {
    color: #157347;
    display: none;
}

.field.is-invalid > .required-status,
.field.is-invalid [data-required-status-label],
.mgmt-section.is-invalid [data-required-status-label] {
    color: #b42318;
}

.field-span-full,
.field.field-span-full {
    grid-column: 1 / -1;
}

label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--mgmt-ink);
    border-radius: 0;
    background: #fff;
    color: var(--mgmt-ink);
    font: inherit;
    padding: 12px 14px;
}

.field.is-valid input,
.field.is-valid textarea,
.field.is-valid select,
.field.is-valid .tag-select-control {
    border-color: #157347;
}

.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select,
.field.is-invalid .tag-select-control {
    border-color: #b42318;
}

.publish-toggle {
    display: grid;
    gap: 8px;
    padding-top: 28px;
}

.publish-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
}

.publish-toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
}

.publish-toggle-note {
    font-size: 11px;
    color: var(--mgmt-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mgmt-section.is-valid .repeater {
    border-left: 2px solid #157347;
    padding-left: 12px;
}

.mgmt-section.is-invalid .repeater {
    border-left: 2px solid #b42318;
    padding-left: 12px;
}

textarea {
    min-height: 180px;
    resize: vertical;
}

.hint {
    color: var(--mgmt-muted);
    font-size: 12px;
    line-height: 1.5;
}

.header-actions {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid var(--mgmt-line);
}

.inline-form {
    margin: 0;
}

.page-heading {
    margin: 0 0 10px;
    font-size: 26px;
    text-transform: uppercase;
    letter-spacing: -0.03em;
}

.edit-artist-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.edit-artist-header .page-heading {
    margin: 0;
}

.edit-artist-header-action {
    margin-left: auto;
    position: relative;
    flex: 0 0 auto;
}

.edit-artist-header-action.is-floating {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 50;
}

.mgmt-logo {
    height: 35px;
}

.mgmt-section {
    grid-column: 1 / -1;
    border-top: 1px solid var(--mgmt-line);
    padding-top: 18px;
    margin-top: 6px;
}

.mgmt-section-title {
    margin: 0 0 14px;
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: -0.03em;
}

.repeater {
    display: grid;
    gap: 12px;
}

.repeater-item {
    border: 1px solid var(--mgmt-line);
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    background: #fff;
}

.repeater-item .field:not(.field-span-full):not(.col-1):not(.col-2):not(.col-3):not(.col-4):not(.col-5):not(.col-6):not(.col-7):not(.col-8):not(.col-9):not(.col-10):not(.col-11):not(.col-12) {
    grid-column: span 6;
}

.repeater-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mgmt-line);
}

.repeater-header strong {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.repeater-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.repeater-empty {
    color: var(--mgmt-muted);
    font-size: 12px;
}

.row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    grid-column: 1 / -1;
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

.image-preview {
    margin-top: 8px;
    border: 1px solid var(--mgmt-line);
    padding: 10px;
    width: fit-content;
    background: #fff;
    cursor: zoom-in;
}

.image-preview img {
    display: block;
    max-height: 30px;
    object-fit: contain;
}

.image-preview video {
    display: block;
    max-width: 220px;
    max-height: 30px;
    background: #000;
}

.image-preview.is-hidden,
.is-hidden {
    display: none !important;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.upload-input {
    font-size: 12px;
}

.upload-input-hidden {
    display: none;
}

.upload-inline {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.upload-inline-preview,
.upload-inline-field {
    min-width: 0;
}

.media-upload-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
}

.media-upload-row .media-upload-field {
    flex: 0 0 auto;
}

.media-upload-field input[type="text"][hidden],
.media-upload-field input[type="hidden"] {
    display: none;
}

.media-upload-tile {
    position: relative;
    width: 170px;
    height: 170px;
    margin-top: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mgmt-soft);
}

.media-upload-tile img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
}

.media-upload-tile video {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    background: #000;
}

.media-upload-tile.is-placeholder img {
    opacity: 0.28;
    object-fit: contain;
    object-position: center;
    padding: 34px;
}

.media-upload-tile.is-placeholder video {
    display: none;
}

.media-upload-tile.is-placeholder::before {
    content: "⚠";
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.88);
    color: #000;
    font-size: 16px;
    line-height: 1;
}

.media-upload-overlay {
    position: absolute;
    inset: auto 10px 10px 10px;
    z-index: 2;
}

.media-upload-overlay .button,
.media-upload-overlay button {
    width: 100%;
    min-height: 38px;
    padding: 10px 12px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
}

.media-upload-overlay .button:hover,
.media-upload-overlay button:hover {
    background: #000;
    color: #fff;
}

.upload-inline-preview {
    justify-self: start;
}

.upload-inline-action {
    display: flex;
    justify-content: flex-end;
}

.upload-inline .image-preview {
    margin-top: 0;
}

.upload-inline .image-preview img,
.upload-inline .image-preview video {
    max-width: 100%;
}

.artwork-type-fields[hidden],
.translation-tab-panel[hidden],
.translation-subsection[hidden],
.tag-select-dropdown[hidden] {
    display: none !important;
}

.prado-artwork-layout {
    overflow: hidden;
}

.prado-artwork-preview {
    float: left;
    margin: 0 14px 14px 0;
}

.prado-artwork-preview-image {
    max-height: 120px;
}

.prado-artwork-form {
    overflow: hidden;
}

.translation-locale {
    display: grid;
    gap: 18px;
}

.translation-subsection {
    display: grid;
    gap: 12px;
}

.translation-subtitle {
    margin: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.media-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
}

.media-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.media-modal-dialog {
    position: absolute;
    inset: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.media-modal-image,
.media-modal-video {
    max-width: 100%;
    max-height: 100%;
    display: block;
    pointer-events: auto;
    background: #000;
}

.media-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 201;
    min-width: 120px;
}

.translation-group {
    display: grid;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--mgmt-line);
}

.translation-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.translation-group-title span {
    color: var(--mgmt-muted);
}

.translation-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.translation-tab-button[aria-selected="true"] {
    background: var(--mgmt-ink);
    color: var(--mgmt-bg);
}

.translation-subtabs {
    margin-top: 12px;
    margin-bottom: 14px;
}

.richtext {
    display: grid;
    gap: 8px;
}

.richtext-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.richtext-toolbar .button {
    min-height: 36px;
    padding: 0 12px;
}

.richtext-editor,
.richtext-source {
    width: 100%;
    min-height: 220px;
    border: 1px solid var(--mgmt-ink);
    padding: 12px 14px;
    background: #fff;
}

.richtext-editor:focus,
.richtext-source:focus,
.tag-select-input:focus {
    outline: none;
}

.richtext-editor p:first-child {
    margin-top: 0;
}

.richtext-editor p:last-child {
    margin-bottom: 0;
}

.richtext-input,
.select-multi,
.upload-input-hidden {
    display: none;
}

.tag-select {
    position: relative;
    display: grid;
    gap: 8px;
}

.tag-select-control {
    min-height: 52px;
    border: 1px solid var(--mgmt-ink);
    background: #fff;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    cursor: text;
}

.tag-select-control:focus-within {
    outline: 1px solid var(--mgmt-ink);
    outline-offset: 0;
}

.tag-select-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tag-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--mgmt-ink);
    background: var(--mgmt-soft);
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tag-select-tag button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 12px;
}

.tag-select-input {
    flex: 1 1 120px;
    min-width: 120px;
    border: 0;
    padding: 0;
    min-height: 24px;
}

.tag-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    border: 1px solid var(--mgmt-ink);
    background: #fff;
    max-height: 220px;
    overflow: auto;
}

.tag-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--mgmt-line);
}

.tag-select-option:last-child {
    border-bottom: 0;
}

.tag-select-option input {
    width: auto;
    margin: 0;
    padding: 0;
}

.tag-select-empty {
    padding: 10px 12px;
    color: var(--mgmt-muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .shell {
        width: calc(100vw - 24px);
        margin: 0 12px;
        padding-top: 16px;
    }

    .nav {
        flex-direction: column;
    }

    .actions,
    .upload-inline-action {
        justify-content: flex-start;
    }

    .edit-artist-header {
        flex-direction: column;
    }

    .edit-artist-header-action {
        margin-left: 0;
        width: 100%;
    }

    .edit-artist-header-action.is-floating {
        width: calc(100vw - 24px);
        right: 12px;
        top: 12px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .footer-actions {
        flex-direction: column;
    }

    .repeater-item {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .row,
    .col-1,
    .col-2,
    .col-3,
    .col-4,
    .col-5,
    .col-6,
    .col-7,
    .col-8,
    .col-9,
    .col-10,
    .col-11,
    .col-12,
    .repeater-item .field {
        grid-column: 1 / -1;
    }

    .upload-inline {
        grid-template-columns: 1fr;
    }
}
