:root {
    --cms-accent: #2563eb;
    --cms-text: #1f2937;
    --cms-muted: #6b7280;
    --cms-border: #e5e7eb;
    --cms-surface: #ffffff;
    --cms-bg: #f7f8fb;
}

body {
    background: var(--cms-bg);
    color: var(--cms-text);
}

.cms-shell {
    min-height: 100vh;
}

.cms-card {
    background: var(--cms-surface);
    border: 1px solid var(--cms-border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.cms-dashboard {
    margin: 0 auto;
    max-width: 1440px;
    padding: 0;
    width: 100%;
}

.cms-dashboard-head {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.cms-dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 24px;
}

.cms-dashboard-grid:last-child {
    margin-bottom: 0;
}

.cms-action-card,
.cms-section-card {
    align-items: flex-start;
    color: var(--cms-text);
    display: flex;
    gap: 14px;
    min-height: 116px;
    padding: 20px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cms-action-card:hover,
.cms-section-card:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
    color: var(--cms-text);
    transform: translateY(-1px);
}

.cms-action-card {
    border-left: 4px solid var(--cms-accent);
}

.cms-card-title,
.cms-card-text {
    display: block;
}

.cms-card-title {
    color: var(--cms-text);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 6px;
}

.cms-card-text {
    color: var(--cms-muted);
    font-size: 0.92rem;
    line-height: 1.35;
}

.cms-icon {
    align-items: center;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 8px;
    color: var(--cms-accent);
    display: inline-flex;
    flex: 0 0 42px;
    font-size: 17px;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    line-height: 1;
    width: 42px;
}

.cms-icon svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 22px;
}

.cms-muted {
    color: var(--cms-muted);
}

.cms-admin-body {
    min-width: 320px;
}

.cms-admin-shell {
    min-height: 100vh;
}

.cms-admin-sidebar {
    background: var(--cms-surface);
    border-right: 1px solid var(--cms-border);
    bottom: 0;
    box-shadow: 18px 0 44px rgba(15, 23, 42, 0.12);
    left: 0;
    max-width: calc(100vw - 48px);
    overflow-y: auto;
    padding: 20px 16px;
    position: fixed;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 300px;
    z-index: 1080;
}

.is-admin-menu-open .cms-admin-sidebar {
    transform: translateX(0);
}

.cms-admin-sidebar-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cms-admin-brand {
    font-weight: 600;
    margin-bottom: 0;
}

.cms-admin-menu-backdrop {
    background: rgba(15, 23, 42, 0.38);
    bottom: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 0;
    transition: opacity 0.2s ease;
    z-index: 1070;
}

.is-admin-menu-open .cms-admin-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.cms-admin-menu-button,
.cms-admin-menu-close {
    align-items: center;
    background: #fff;
    border: 1px solid var(--cms-border);
    border-radius: 8px;
    color: var(--cms-text);
    display: inline-flex;
    flex: 0 0 auto;
    height: 40px;
    justify-content: center;
    padding: 0;
    width: 40px;
}

.cms-admin-menu-button {
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 1090;
}

.is-admin-menu-open .cms-admin-menu-button {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

.cms-admin-menu-button span,
.cms-admin-menu-close span {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 18px;
}

.cms-admin-menu-close {
    position: relative;
}

.cms-admin-menu-close span {
    left: 10px;
    position: absolute;
    top: 19px;
}

.cms-admin-menu-close span:first-child {
    transform: rotate(45deg);
}

.cms-admin-menu-close span:last-child {
    transform: rotate(-45deg);
}

.cms-admin-main {
    min-width: 0;
    padding: clamp(24px, 3vw, 40px);
}

.cms-admin-topbar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin: 0 auto 24px;
    max-width: 1440px;
    width: 100%;
}

.cms-admin-content {
    margin: 0 auto;
    max-width: 1440px;
    width: 100%;
}

.cms-admin-content > *:last-child {
    margin-bottom: 0;
}

.cms-admin-content .table-responsive {
    border-radius: 8px;
}

.cms-media-thumb {
    align-items: center;
    background: #f3f4f6;
    border: 1px solid var(--cms-border);
    border-radius: 8px;
    display: flex;
    height: 84px;
    justify-content: center;
    overflow: hidden;
    width: 84px;
}

.cms-media-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.cms-chatbot {
    bottom: 20px;
    position: fixed;
    right: 20px;
    z-index: 1050;
}

.cms-chatbot-toggle {
    background: var(--cms-accent);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.26);
    color: #fff;
    font-weight: 600;
    padding: 12px 18px;
}

.cms-chatbot-panel {
    background: #fff;
    border: 1px solid var(--cms-border);
    border-radius: 8px;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    height: min(640px, calc(100vh - 40px));
    overflow: hidden;
    width: min(380px, calc(100vw - 40px));
}

.cms-chatbot-head {
    align-items: center;
    border-bottom: 1px solid var(--cms-border);
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
}

.cms-chatbot-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 16px;
}

.cms-chatbot-message {
    border-radius: 8px;
    max-width: 88%;
    padding: 10px 12px;
}

.cms-chatbot-message.bot {
    align-self: flex-start;
    background: #f3f4f6;
}

.cms-chatbot-message.visitor {
    align-self: flex-end;
    background: var(--cms-accent);
    color: #fff;
}

.cms-chatbot-form {
    border-top: 1px solid var(--cms-border);
    padding: 12px;
}

.cms-chatbot-options {
    display: grid;
    gap: 8px;
}

.cms-chatbot-products {
    display: grid;
    gap: 10px;
}

.cms-chatbot-product {
    border: 1px solid var(--cms-border);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 10px;
}

.cms-chatbot-product img {
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    object-fit: cover;
    width: 100%;
}

.cms-editor-field .ql-toolbar.ql-snow {
    background: #fff;
    border-color: var(--cms-border);
    border-radius: 8px 8px 0 0;
}

.cms-editor-field .ql-container.ql-snow {
    background: #fff;
    border-color: var(--cms-border);
    border-radius: 0 0 8px 8px;
    min-height: 340px;
}

.cms-editor-field .ql-editor {
    font-size: 1rem;
    line-height: 1.7;
    min-height: 340px;
}

.cms-rich-editor-source {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.cms-editor-field.is-rich-editor-disabled .cms-rich-editor {
    display: none;
}

@media (max-width: 991.98px) {
    .cms-admin-main {
        padding: 20px;
    }
}

@media (max-width: 575.98px) {
    .cms-dashboard-head {
        flex-direction: column;
    }

    .cms-admin-main {
        padding: 16px;
    }

    .cms-admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
