:root {
    --color-primary: #1557b0;
    --site-header-height: 106px;
    font-family: Inter,
        system-ui, -apple-system,
        sans-serif;
    color: #172033;
    background: #f4f6f9;
    line-height: 1.45
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

button, input, select, textarea {
    font: inherit
}

nav a, nav button {
    /* color: #164ea6; */
    color:black;
    text-transform: uppercase;
    font-size: 18px;
    text-decoration: none;
}


.site-header {
    height: var(--site-header-height);
    background: #fff;
    /* border-bottom: 1px solid #dfe4eb; */
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 0 max(24px, calc((100% - 1180px)/2));
    position: sticky;
    top: 0;
    z-index: 20
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    /* max-width: 100px;
    max-height: 100px; */
    text-decoration: none;
    flex: 0 0 auto
}

.brand-logo {
    display: block;
    width: auto;
    height: 80px;
    /* max-width: auto; */
    max-height: 80px;
    margin-top: 5px;
    margin-bottom: 5px;
    object-fit: contain
}

.site-header-title {
    grid-column: 2;
    justify-self: center;
    color: #172033;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    text-transform: uppercase
}

.site-header nav {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 22px
}

.site-header nav form {
    margin: 0
}

.link-button {
    border: 0;
    background: none;
    /* color: #164ea6; */
    cursor: pointer
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 38px 24px
}

.narrow {
    max-width: 940px
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px
}

.page-title h1, .section-heading h1 {
    margin: 4px 0 6px;
    font-size: clamp(1.7rem, 4vw, 2.3rem)
}

.eyebrow, .section-heading>p {
    margin: 0;
    color: #596780;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 800;
    font-size: .77rem
}

.muted, .section-heading span {
    color: #637087
}

.button {
    border: 1px solid #c9d1dd;
    border-radius: 9px;
    background: #fff;
    color: #26334a;
    padding: 10px 15px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.button:hover {
    background: #f0f4f9
}

.button.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff
}

.button.success {
    background: #087443;
    border-color: #087443;
    color: #fff
}

.button.danger {
    color: #b42318;
    border-color: #f0b4af
}

.modal-actions .button.danger {
    background: #b42318;
    border-color: #b42318;
    color: #fff
}

.modal-actions .button.danger:hover {
    background: #941b13;
    border-color: #941b13
}

.button.small {
    padding: 7px 10px;
    font-size: .88rem
}

.button.large {
    padding: 13px 20px
}

.panel {
    background: #fff;
    border: 1px solid #dfe4eb;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 18px rgba(23, 32, 51, .05)
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px
}

.login-panel {
    width: min(440px, 100%)
}

.stack {
    display: grid;
    gap: 18px;
    margin-top: 28px
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    color: #334057
}

input, select, textarea {
    width: 100%;
    border: 1px solid #bfc8d5;
    border-radius: 9px;
    background: #fff;
    padding: 12px 13px;
    color: #172033
}

input:focus, select:focus, textarea:focus {
    outline: 3px solid #cfe1ff;
    border-color: #1557b0
}

.alert {
    padding: 12px;
    border-radius: 8px
}

.alert.error {
    background: #fee4e2;
    color: #912018
}

.search, .inline-form {
    display: flex;
    gap: 12px;
    align-items: end;
    margin-bottom: 24px
}

.search input {
    max-width: 460px
}

.empty {
    text-align: center;
    padding: 70px 24px;
    background: #fff;
    border: 1px dashed #bfc8d5;
    border-radius: 14px
}

.product-list {
    display: grid;
    gap: 12px
}

.product-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    align-items: center;
    gap: 18px;
    background: #fff;
    border: 1px solid #dfe4eb;
    border-radius: 12px;
    padding: 18px
}

.product-main h2 {
    font-size: 1.08rem;
    margin: 0 0 4px
}

.product-main p {
    margin: 0;
    color: #637087
}

.actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.actions form {
    margin: 0
}

.badge {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800
}

.badge.draft {
    background: #eef1f5;
    color: #4f5d73
}

.badge.complete {
    background: #dff7ea;
    color: #087443
}

.badge.review {
    background: #fff1cc;
    color: #7a5400
}

.category-tree {
    display: block;
    padding: 0;
    margin: 0;
    list-style: none
}

.categories-page {
    padding-top: 14px;
    padding-bottom: 28px
}

.category-create-panel {
    padding: 16px 18px;
    margin-bottom: 14px
}

.category-create-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px
}

.category-create-heading h2 {
    margin: 0;
    font-size: 1.25rem
}

.category-create-form {
    align-items: end;
    margin-bottom: 0
}

.category-create-form label {
    flex: 1 1 0;
    min-width: 0
}

.category-create-form .button {
    flex: 0 0 auto;
    white-space: nowrap
}

.category-tree-panel {
    padding: 6px 16px
}

.category-children {
    padding: 0 0 0 12px;
    margin: 0 0 0 26px;
    border-left: 1px solid #dfe4eb;
    list-style: none
}

.category-node+.category-node, .category-children>.category-node {
    border-top: 1px solid #edf0f4
}

.category-tree-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 5px 0
}

.category-toggle, .category-toggle-spacer {
    width: 30px;
    height: 36px;
    flex: 0 0 30px
}

.category-toggle {
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #536179;
    cursor: pointer;
    font-size: .82rem
}

.category-toggle:hover, .category-toggle:focus-visible {
    background: #eef4ff;
    color: var(--color-primary)
}

.category-node-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.category-node-name {
    color: #26334a;
    font-weight: 750
}

.category-node-control {
    padding: 8px 4px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer
}

.category-node-control:hover, .category-node-control:focus-visible {
    background: #eef4ff;
    outline: none
}

.category-node-control:hover .category-node-name, .category-node-control:focus-visible .category-node-name {
    color: var(--color-primary)
}

.category-count {
    color: #7b8799;
    font-weight: 600
}

.category-node-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px
}

.category-node-actions form {
    margin: 0
}

.category-node-actions .icon-button {
    width: auto;
    min-width: 38px;
    height: 38px;
    gap: 6px;
    padding: 0 9px !important;
    font-size: .82rem;
    white-space: nowrap
}

.category-node-actions .icon-button svg {
    flex: 0 0 auto
}

@media(max-width:700px) {
    .category-action-label {
        display: none
    }

    .category-node-actions .icon-button {
        width: 38px;
        padding: 0 !important
    }
}

.category-edit-form {
    display: grid;
    gap: 14px
}

.category-edit-form label {
    margin: 0
}

.category-edit-feedback {
    margin: 0
}

.category-edit-feedback:empty {
    display: none
}

.editor-bar {
    position: sticky;
    top: var(--site-header-height);
    z-index: 15;
    background: #fff;
    border-bottom: 1px solid #dfe4eb;
    box-shadow: 0 5px 15px rgba(23, 32, 51, .07);
    min-height: 72px;
    padding: 10px max(18px, calc((100% - 1180px)/2));
    display: flex;
    align-items: center;
    gap: 16px
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1
}

.editor-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.save-status {
    color: #637087;
    font-weight: 700
}

.save-status.error {
    color: #b42318
}

.editor-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 24px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px
}

.steps {
    list-style: none;
    padding: 0;
    margin: 0;
    position: sticky;
    top: 166px;
    align-self: start
}

.steps button {
    width: 100%;
    border: 0;
    background: none;
    text-align: left;
    padding: 11px 8px;
    border-radius: 8px;
    color: #596780;
    cursor: pointer;
    font-weight: 700
}

.steps button span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5eaf1;
    margin-right: 8px
}

.steps button.active {
    background: #eaf2ff;
    color: #164ea6
}

.steps button.active span {
    background: #1557b0;
    color: #fff
}

.step-panel {
    display: none;
    background: #fff;
    border: 1px solid #dfe4eb;
    border-radius: 14px;
    padding: 30px
}

.step-panel.active {
    display: block
}

.section-heading {
    margin-bottom: 28px
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.full {
    grid-column: 1/-1
}

.category-tools {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap
}

.check {
    display: flex;
    grid-auto-flow: column;
    align-items: center;
    justify-content: start
}

.check input, .choice input {
    width: auto
}

.info {
    margin-top: 24px;
    background: #eaf2ff;
    color: #254e83;
    padding: 14px;
    border-radius: 9px
}

.choice {
    border: 0;
    padding: 0;
    margin: 0 0 24px
}

.choice legend {
    font-weight: 800;
    margin-bottom: 10px
}

.choice label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 24px
}

.repeat-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    background: #f7f8fa;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px
}

.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 18px
}

.inner {
    margin-top: 20px
}

.upload-box {
    border: 2px dashed #bfc8d5;
    border-radius: 12px;
    padding: 20px;
    text-align: center
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    margin-top: 20px
}

.image-card {
    border: 1px solid #dfe4eb;
    border-radius: 10px;
    padding: 10px;
    display: grid;
    gap: 10px
}

.image-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #f2f4f7;
    border-radius: 7px
}

.review {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px
}

.review div {
    padding: 11px 0;
    border-bottom: 1px solid #e4e8ee
}

.review dt {
    color: #637087
}

.review dd {
    margin: 3px 0 0;
    font-weight: 800
}

.review-actions {
    margin-top: 24px;
    border-top: 1px solid #dfe4eb;
    padding-top: 20px
}

.message {
    text-align: center;
    margin-top: 50px
}

@media(max-width:800px) {
    :root {
        --site-header-height: 80px
    }

    .site-header {
        padding: 0 14px
    }

    .brand-logo {
        /* width: auto; */
        height: 72px;
        /* max-width: 72px; */
        max-height: 72px
    }

    .site-header-title {
        font-size: 26px
    }

    .site-header nav a {
        display: none
    }

    .editor-bar {
        top: var(--site-header-height);
        flex-wrap: wrap
    }

    .editor-title {
        order: 3;
        flex-basis: 100%
    }

    .editor-shell {
        display: block;
        padding: 16px
    }

    .steps {
        position: static;
        display: flex;
        overflow: auto;
        margin-bottom: 14px
    }

    .steps li {
        flex: 0 0 auto
    }

    .steps button {
        font-size: 0
    }

    .steps button span {
        font-size: .9rem;
        margin: 0
    }

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

    .full {
        grid-column: auto
    }

    .product-row {
        grid-template-columns: 1fr auto
    }

    .product-row time {
        display: none
    }

    .product-row .actions {
        grid-column: 1/-1
    }

    .page-title {
        align-items: center
    }

    .category-tree-panel {
        padding-right: 10px;
        padding-left: 10px
    }

    .category-children {
        margin-left: 14px;
        padding-left: 8px
    }

    .repeat-row {
        grid-template-columns: 1fr
    }

    .inline-form, .search:not(.catalog-search) {
        align-items: stretch;
        flex-direction: column
    }

    .review {
        grid-template-columns: 1fr
    }
}

@media(max-width:420px) {
    :root {
        --site-header-height: 64px
    }

    .site-header {
        gap: 8px;
        padding: 0 10px
    }

    .brand-logo {
        /* width: auto; */
        height: 56px;
        /* max-width: 56px; */
        max-height: 56px
    }

    .site-header-title {
        font-size: 20px
    }
}
