* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #fafafa;
    color: #222;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

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

img {
    max-width: 100%;
}

header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 1rem 2rem;
}

header .header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

header h1 {
    margin: 0;
    font-size: 1.4rem;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}


/* =====================================================
   Buttons
   ===================================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;

    padding: .65rem 1rem;

    border: 1px solid #222;
    border-radius: 6px;

    background: #222;
    color: #fff;

    cursor: pointer;

    font: inherit;
    text-decoration: none;
}

.button:hover {
    opacity: .85;
}

.button.secondary {
    background: #fff;
    color: #222;
    border-color: #ccc;
}

button.button {
    appearance: none;
}


/* =====================================================
   Management
   ===================================================== */

.manage-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 2rem;
}

.manage-header h1 {
    margin: 0 0 .3rem 0;
}

.muted {
    color: #777;
    font-size: .9rem;
}


/* =====================================================
   Properties
   ===================================================== */

.properties-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(300px, 1fr)
    );
    gap: 1.5rem;
}

.property-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.property-panel h2 {
    margin-top: 0;
}

.property-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1rem;
}

.property-list {
    display: flex;
    flex-direction: column;
}

.property-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: .8rem 0;

    border-bottom: 1px solid #eee;
}

.property-row:first-child {
    padding-top: 0;
}

.property-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.property-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.property-actions form {
    margin: 0;
}

.link-button {
    border: 0;
    padding: 0;

    background: transparent;
    color: #444;

    cursor: pointer;
    font: inherit;

    text-decoration: underline;
}

.link-button:hover {
    color: #000;
}

.link-button.danger {
    color: #a00;
}

.empty-small {
    margin: 0;
    color: #777;
}


/* =====================================================
   Forms
   ===================================================== */

.form-field {
    margin-bottom: 1.25rem;
}

.form-field label {
    display: block;
    margin-bottom: .4rem;

    font-weight: 600;
}

.form-field input[type="text"],
.form-field input[type="search"],
.form-field input[type="number"],
.form-field input[type="email"],
.form-field input[type="url"],
.form-field input[type="file"],
.form-field textarea,
.form-field select {
    width: 100%;

    padding: .65rem .75rem;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #fff;
    color: #222;

    font: inherit;
}

.form-field textarea {
    resize: vertical;
}

.form-field select[multiple] {
    min-height: 180px;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: #777;
}

.form-field input[type="checkbox"],
.form-field input[type="radio"] {
    width: auto;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: .5rem;
    font-weight: normal !important;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;

    margin-top: 1.5rem;
}

.form-errors {
    margin-top: .4rem;
    color: #a00;
}

.form-errors ul {
    margin: 0;
    padding-left: 1.2rem;
}


/* =====================================================
   Search fields
   ===================================================== */

.search-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.property-search {
    width: 100%;

    padding: .65rem .75rem;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #fff;

    font: inherit;
}

.property-search:focus {
    outline: none;
    border-color: #777;
}


/* =====================================================
   Asset management
   ===================================================== */

.asset-search {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.asset-search input[type="search"] {
    flex: 1 1 300px;

    min-width: 200px;

    padding: .65rem .75rem;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #fff;
    color: #222;

    font: inherit;
}

.asset-search input[type="search"]:focus {
    outline: none;
    border-color: #777;
}

.asset-list-preview {
    width: 80px;
    height: 80px;

    flex: 0 0 80px;

    overflow: hidden;

    border-radius: 6px;

    background: #eee;
}

.asset-list-preview a {
    display: block;

    width: 100%;
    height: 100%;
}

.asset-list-preview img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.asset-list-preview-empty {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: .5rem;

    text-align: center;

    color: #777;
    font-size: .75rem;
}

.asset-list-info {
    flex: 1 1 auto;
    min-width: 0;
}

.gallery-filters {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;

    margin-bottom: 2rem;

    padding: 1rem;

    background: #fff;

    border: 1px solid #ddd;
    border-radius: 8px;
}

.gallery-filter-field {
    flex: 1 1 240px;
    min-width: 200px;
}

.gallery-filter-field label {
    display: block;

    margin-bottom: .4rem;

    font-weight: 600;
}

.gallery-filter-field select {
    width: 100%;

    padding: .65rem .75rem;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #fff;
    color: #222;

    font: inherit;
}

.gallery-filter-field select:focus {
    outline: none;
    border-color: #777;
}

.gallery-filter-actions {
    display: flex;
    align-items: center;
    gap: .5rem;

    flex-wrap: wrap;
}

.gallery-filter-field input[type="search"] {
    width: 100%;

    padding: .65rem .75rem;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #fff;
    color: #222;

    font: inherit;
}

.gallery-filter-field input[type="search"]:focus {
    outline: none;
    border-color: #777;
}


/* =====================================================
   Assets
   ===================================================== */

.asset-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(240px, 1fr)
        );

    gap: 1.5rem;
}

.asset-card {
    background: #fff;

    border: 1px solid #ddd;
    border-radius: 8px;

    overflow: hidden;
}

.asset-card:hover {
    border-color: #aaa;
}

.asset-image {
    width: 100%;
    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: #eee;

    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.asset-card-content {
    padding: 1rem;
}

.asset-card-content h2 {
    margin: 0 0 .4rem 0;
    font-size: 1.1rem;
}


/* =====================================================
   Detail Gallery
   ===================================================== */

.detail-gallery {
    margin: 2rem 0;
}

.detail-gallery-stage {
    position: relative;

    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eee;

    border-radius: 8px;

    overflow: hidden;
}

.detail-gallery-slide {
    display: none;

    width: 100%;
}

.detail-gallery-slide.active {
    display: block;
}

.detail-gallery-slide a {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 300px;
}

.detail-gallery-slide img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;

    max-height: 75vh;

    object-fit: contain;
}

.detail-gallery-button {
    position: absolute;

    top: 50%;
    transform: translateY(-50%);

    z-index: 2;

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: rgba(255, 255, 255, .85);
    color: #222;

    font-size: 1.8rem;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.detail-gallery-button:hover {
    background: #fff;
}

.detail-gallery-prev {
    left: 1rem;
}

.detail-gallery-next {
    right: 1rem;
}

.detail-gallery-caption {
    margin-top: .75rem;

    text-align: center;

    color: #555;
}

.detail-gallery-counter {
    margin-top: .5rem;

    text-align: center;

    color: #777;

    font-size: .9rem;
}


/* =====================================================
   Legacy Detail Images
   ===================================================== */

.detail-images {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 1.5rem;

    margin-bottom: 2rem;
}

.detail-images a {
    display: block;
}

.detail-images img {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 6px;
}


/* =====================================================
   Image management
   ===================================================== */

.image-edit-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-edit-row {
    display: flex;
    align-items: center;
    gap: 1rem;

    padding: 1rem 0;

    border-bottom: 1px solid #eee;
}

.image-edit-row:last-child {
    border-bottom: 0;
}

.image-edit-preview {
    width: 100px;
    height: 100px;

    flex: 0 0 100px;

    background: #eee;

    border-radius: 6px;

    overflow: hidden;
}

.image-edit-preview img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

.image-edit-info {
    flex: 1;
    min-width: 0;
}

.image-inline-field {
    margin-top: .75rem;
    margin-bottom: .75rem;
}


/* =====================================================
   Responsive
   =============================================
