body.cms-page {
    background: #f3f4f6;
}

.cms-shell {
    padding: 48px 0 80px;
}

.cms-intro {
    margin-bottom: 28px;
}

.cms-auth-panel[hidden] {
    display: none !important;
}

.cms-intro h1 {
    margin-bottom: 12px;
    font-size: 38px;
    color: #1f2f46;
}

.cms-intro p {
    max-width: 760px;
    font-size: 16px;
    line-height: 1.7;
    color: #5a6472;
}

.cms-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 24px;
}

.cms-panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(31, 47, 70, 0.08);
    padding: 28px 24px;
}

.cms-session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(31, 47, 70, 0.08);
}

.cms-session-bar__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #475467;
}

.cms-session-bar__copy strong {
    color: #1f2f46;
}

.cms-section + .cms-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid #e8ebef;
}

.cms-section h2 {
    margin-bottom: 6px;
    font-size: 24px;
    color: #1f2f46;
}

.cms-section p {
    margin-bottom: 18px;
    color: #667085;
}

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

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

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

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

.cms-hidden {
    display: none !important;
}

.cms-field label {
    font-weight: 700;
    color: #1f2f46;
}

.cms-field input,
.cms-field textarea,
.cms-field select {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 15px;
    color: #1f2937;
    background: #fff;
}

.cms-field textarea {
    min-height: 110px;
    resize: vertical;
}

.cms-code-field {
    min-height: 280px !important;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
}

.cms-field-checkbox {
    justify-content: center;
}

.cms-field-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.cms-field-checkbox input {
    width: 18px;
    min-height: 18px;
}

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

.cms-check-grid__item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #fff;
    font-weight: 600;
    color: #1f2f46;
}

.cms-check-grid__item input {
    width: 18px;
    min-height: 18px;
    margin: 0;
}

.cms-help-text {
    display: block;
    margin-top: 6px;
    color: #667085;
    font-size: 12px;
    line-height: 1.5;
}

.cms-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.cms-button {
    border: 0;
    border-radius: 12px;
    min-height: 46px;
    padding: 0 18px;
    font-weight: 700;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.cms-button:hover {
    transform: translateY(-1px);
}

.cms-button--small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

.cms-button--primary {
    background: #ea1c26;
    color: #fff;
}

.cms-button--secondary {
    background: #1f2f46;
    color: #fff;
}

.cms-button--ghost {
    background: #eef2f6;
    color: #1f2f46;
}

.cms-status {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #e9f7ef;
    color: #1c6a38;
    display: none;
}

.cms-status.is-visible {
    display: block;
}

.cms-status.is-error {
    background: #fdecec;
    color: #b42318;
}

.cms-sidebar-card + .cms-sidebar-card {
    margin-top: 20px;
}

.cms-sidebar-card h3 {
    margin-bottom: 10px;
    font-size: 20px;
    color: #1f2f46;
}

.cms-sidebar-card p,
.cms-sidebar-card li {
    color: #667085;
    line-height: 1.7;
}

.cms-sidebar-card ul {
    margin: 0;
    padding-left: 18px;
}

.cms-preview-card {
    display: grid;
    gap: 10px;
}

.cms-preview-row {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f7f8fa;
    color: #344054;
}

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

.cms-product-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 24px;
}

.cms-table-toolbar {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.cms-table-filter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cms-table-filter label {
    margin: 0;
    font-weight: 700;
    color: #1f2f46;
}

.cms-table-filter select {
    min-width: 220px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    font-size: 15px;
}

.cms-table-search input {
    min-width: 280px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    font-size: 15px;
}

.cms-table-wrap {
    overflow-x: auto;
}

.cms-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.cms-table th,
.cms-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e8ebef;
    text-align: left;
    vertical-align: top;
}

.cms-table th {
    color: #1f2f46;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cms-table td {
    color: #475467;
}

.cms-product-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cms-image-manager {
    display: grid;
    gap: 14px;
}

.cms-image-preview {
    width: 100%;
    min-height: 180px;
    border: 1px dashed #c9d0db;
    border-radius: 16px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #667085;
    text-align: center;
    padding: 16px;
}

.cms-image-preview img {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    display: block;
}

.cms-gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 12px;
    min-height: 120px;
    border: 1px dashed #c9d0db;
    border-radius: 16px;
    background: #f8fafc;
    padding: 14px;
    color: #667085;
}

.cms-gallery-preview > span {
    grid-column: 1 / -1;
    display: flex;
    min-height: 90px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cms-gallery-preview-item {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: 4 / 3;
    border: 1px solid #e8ebef;
}

.cms-gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cms-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cms-table-image {
    width: 68px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: #f7f8fa;
}

.cms-table-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


.cms-category-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cms-category-tag--cars {
    background: rgba(31, 47, 70, 0.1);
    color: #1f2f46;
}

.cms-category-tag--sold-cars {
    background: rgba(143, 55, 172, 0.12);
    color: #6e2f85;
}

.cms-category-tag--spare-parts {
    background: rgba(234, 28, 38, 0.1);
    color: #c0121f;
}

.cms-category-tag--car-accessories {
    background: rgba(10, 141, 115, 0.12);
    color: #0a8d73;
}

.cms-article-grid .cms-image-preview {
    min-height: 220px;
}

.cms-auth-panel {
    margin-bottom: 28px;
}

.cms-auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, #13213b, #223765 58%, #304c87);
    color: #ffffff;
    box-shadow: 0 24px 60px rgba(17, 29, 56, 0.18);
}

.cms-auth-copy h2 {
    margin-bottom: 10px;
    color: #ffffff;
}

.cms-auth-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.cms-auth-form {
    padding: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
}

.cms-auth-form.is-authenticated input {
    opacity: 0.6;
}

.cms-auth-form.is-authenticated input,
.cms-auth-form.is-authenticated button[type="submit"] {
    pointer-events: none;
}

.cms-auth-form .cms-field label {
    color: #ffffff;
}

.cms-auth-form .cms-field input {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.96);
}

.cms-protected[hidden] {
    display: none !important;
}

@media (max-width: 991px) {
    .cms-grid {
        grid-template-columns: 1fr;
    }

    .cms-product-grid {
        grid-template-columns: 1fr;
    }

    .cms-auth-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .cms-shell {
        padding: 32px 0 56px;
    }

    .cms-intro h1 {
        font-size: 30px;
    }

    .cms-panel {
        padding: 22px 18px;
    }

    .cms-fields {
        grid-template-columns: 1fr;
    }

    .cms-detail-grid {
        grid-template-columns: 1fr;
    }

    .cms-check-grid {
        grid-template-columns: 1fr;
    }

    .cms-table-toolbar {
        justify-content: stretch;
    }

    .cms-table-filter {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .cms-table-filter select,
    .cms-table-search input {
        min-width: 0;
        width: 100%;
    }

    .cms-session-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .cms-session-bar .cms-button,
    .cms-actions .cms-button,
    .cms-image-actions .cms-button {
        width: 100%;
    }

    .cms-image-preview {
        min-height: 150px;
        padding: 12px;
    }

    .cms-image-preview img {
        max-height: 180px;
    }

    .cms-gallery-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cms-auth-card {
        padding: 20px 18px;
        border-radius: 20px;
    }

    .cms-auth-form {
        padding: 18px;
    }
}
