:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #20252a;
    background: #f5f6f7
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

.hidden {
    display: none !important
}

button,
input,
select,
textarea {
    font: inherit
}

.topbar {
    height: 68px;
    background: #181b1e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px
}

.topbar strong {
    font-size: 18px
}

.topbar span {
    margin-left: 12px;
    color: #aeb5bb;
    font-size: 13px
}

.topbar #admin-email {
    font-size: 13px;
    color: #cfd4d8
}

.shell {
    max-width: 1250px;
    margin: 0 auto;
    padding: 34px 24px
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px
}

.page-head h1 {
    margin: 0;
    font-size: 30px
}

.page-head p {
    margin: 5px 0 0;
    color: #727980
}

.actions,
.toolbar,
.modal-actions,
.section-title {
    display: flex;
    gap: 10px;
    align-items: center
}

.toolbar {
    background: #fff;
    border: 1px solid #e1e4e7;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 18px
}

.toolbar input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.toolbar select {
  flex: 1 1 0;
  min-width: 0;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d7dce0;
    border-radius: 7px;
    padding: 10px 11px;
    background: #fff;
    color: #20252a
}

textarea {
    resize: vertical
}

button,
.upload-button {
    border: 0;
    border-radius: 7px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600
}

.primary,
.upload-button {
    background: #e7762c;
    color: #fff
}

.secondary {
    background: #eef0f2;
    color: #30363b;
    border: 1px solid #dce0e3
}

.danger {
    color: #ad2a2a
}

.solid-danger {
    background: #ad2a2a;
    color: #fff;
    border: 1px solid #ad2a2a
}

.ghost {
    background: transparent;
    border: 1px solid #e4bbbb
}

.table-wrap {
    background: #fff;
    border: 1px solid #e1e4e7;
    border-radius: 10px;
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse
}

th,
td {
    text-align: left;
    padding: 14px;
    border-bottom: 1px solid #edf0f2;
    vertical-align: middle
}

th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #737a80;
    background: #fafafa
}

.project-name {
    font-weight: 700
}

.project-slug {
    font-size: 12px;
    color: #81878c;
    margin-top: 3px
}

.status-badge {
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 5px 9px
}

.status-badge.active {
    background: #e9f7ee;
    color: #23773c
}

.status-badge.inactive {
    background: #f1f1f1;
    color: #777
}

.edit-button {
    background: #fff;
    border: 1px solid #d9dde0;
    color: #333
}

.loading,
.empty {
    text-align: center;
    padding: 38px;
    color: #777
}

.empty.small {
    padding: 16px;
    border: 1px dashed #d7dce0;
    border-radius: 8px
}

.status-area,
.modal-status {
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 14px
}

.status-area.success,
.modal-status.success {
    background: #e8f6ed;
    color: #236b39
}

.status-area.error,
.modal-status.error {
    background: #fdeaea;
    color: #912b2b
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 15, 17, .62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 20
}

.modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, .28);
    max-height: 92vh;
    overflow: auto;
    width: min(720px, 100%)
}

.modal.wide {
    width: min(1050px, 100%)
}

.modal-head {
    position: sticky;
    top: 0;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecee;
    z-index: 2
}

.modal-head h2 {
    margin: 0
}

.modal-head small {
    color: #777
}

.icon-button {
    background: transparent;
    font-size: 30px;
    line-height: 1;
    padding: 0 5px;
    color: #666
}

#project-form {
    padding: 22px 24px
}

.grid.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px
}

.grid label,
.full {
    display: block;
    font-size: 13px;
    font-weight: 650;
    color: #555
}

.grid input,
.grid select,
.full textarea {
    margin-top: 6px
}

.full {
    margin-top: 15px
}

.images-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #e4e7e9
}

.section-title {
    justify-content: space-between
}

.section-title h3 {
    margin: 0
}

.section-title p {
    margin: 4px 0 0;
    color: #777;
    font-size: 12px
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px
}

.image-card {
    position: relative;
    border: 1px solid #dfe3e6;
    border-radius: 9px;
    overflow: hidden;
    background: #fafafa
}

.image-card img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    background: #eee;
    display: block
}

.image-meta {
    padding: 9px;
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.image-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 0 9px 9px
}

.image-actions button {
    font-size: 11px;
    padding: 7px;
    background: #fff;
    border: 1px solid #d9dde0
}

.image-actions .thumb {
    grid-column: 1/-1
}

.image-actions .danger {
    color: #a52d2d
}

.thumb-badge {
    position: absolute;
    margin: 7px;
    z-index: 1;
    background: #181b1e;
    color: #fff;
    font-size: 10px;
    padding: 4px 6px;
    border-radius: 4px
}

.modal-actions {
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #e5e8ea
}

.danger-actions {
    display: flex;
    gap: 8px
}

.spacer {
    flex: 1
}

.categories-modal {
    padding-bottom: 20px
}

.category-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 100px auto;
    gap: 8px;
    padding: 10px 20px;
    align-items: center
}

.category-order {
    font-weight: 700;
    color: #777;
    text-align: center
}

.category-count {
    font-size: 12px;
    color: #777
}

.category-actions {
    display: flex;
    gap: 6px
}

.category-add {
    display: grid;
    grid-template-columns: 1fr 1fr 90px auto;
    gap: 8px;
    padding: 18px 20px;
    border-top: 1px solid #e5e8ea;
    margin-top: 10px
}

@media(max-width:760px) {
    .topbar {
        padding: 0 16px
    }

    .shell {
        padding: 22px 12px
    }

    .page-head {
        align-items: flex-start;
        gap: 15px
    }

    .toolbar {
        flex-wrap: wrap
    }

    .toolbar input {
        flex-basis: 100%
    }

    .grid.two {
        grid-template-columns: 1fr
    }

    .overlay {
        padding: 8px
    }

    .modal {
        max-height: 97vh
    }

    .modal-actions {
        flex-wrap: wrap
    }

    .danger-actions {
        width: 100%
    }

    .danger-actions button {
        flex: 1
    }

    .category-row,
    .category-add {
        grid-template-columns: 1fr
    }

    .category-order {
        text-align: left
    }
}

#search-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}