﻿.cms-page {
    display: grid;
    gap: 14px;
    --text: #0f172a;
    --muted: #475569;
    --line: rgba(15,23,42,.12);
}

/* Header */
.cms-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

    .cms-header .title {
        margin: 0;
        font-weight: 950;
        letter-spacing: .2px;
        color: var(--text);
    }

    .cms-header .subtitle {
        color: var(--muted);
        font-size: 13px;
        margin-top: 4px;
        font-weight: 600;
    }

/* Card */
.cms-card {
    background: #fff !important;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(2,6,23,.06);
}

/* KPI */
.cms-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 14px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(2,6,23,.05);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    cursor: pointer;
    user-select: none;
}

    .stat:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(2,6,23,.08);
        border-color: rgba(37,99,235,.18);
    }

    .stat:active {
        transform: translateY(-1px);
    }

    .stat .icon {
        width: 44px;
        height: 44px;
        border-radius: 16px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(15,23,42,.10);
        background: rgba(15,23,42,.03);
        color: rgba(15,23,42,.72);
    }

    .stat .label {
        font-size: 12px;
        color: rgba(15,23,42,.72);
        font-weight: 950;
        letter-spacing: .01em;
    }

    .stat .value {
        font-size: 26px;
        font-weight: 950;
        margin-top: 2px;
        color: rgba(15,23,42,.94);
        line-height: 1.1;
    }

    .stat.is-active {
        border-color: rgba(37,99,235,.26);
        box-shadow: 0 0 0 4px rgba(37,99,235,.10), 0 14px 30px rgba(2,6,23,.08);
    }

.stat-total .icon {
    background: rgba(37,99,235,.08);
    border-color: rgba(37,99,235,.18);
    color: rgba(37,99,235,.95);
}

.stat-live .icon {
    background: rgba(34,197,94,.10);
    border-color: rgba(34,197,94,.20);
    color: rgba(21,128,61,.95);
}

.stat-draft .icon {
    background: rgba(245,158,11,.12);
    border-color: rgba(245,158,11,.22);
    color: rgba(146,64,14,.98);
}

.stat-deleted {
    background: rgba(220,38,38,.04);
    border-color: rgba(220,38,38,.16);
}

    .stat-deleted .icon {
        background: rgba(220,38,38,.10);
        border-color: rgba(220,38,38,.22);
        color: rgba(185,28,28,.98);
    }

    .stat-deleted.is-active {
        border-color: rgba(220,38,38,.24);
        box-shadow: 0 0 0 4px rgba(220,38,38,.10), 0 14px 30px rgba(2,6,23,.08);
    }

/* Filters */
.cms-filters {
    display: grid;
    grid-template-columns: 1.4fr .8fr .9fr .5fr;
    gap: 10px;
    align-items: end;
}

    .cms-filters .field label {
        font-size: 12px;
        font-weight: 900;
        color: rgba(15,23,42,.78);
        margin-bottom: 6px;
    }

.input-icon {
    position: relative;
}

    .input-icon i {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        opacity: .70;
        color: rgba(15,23,42,.75);
    }

    .input-icon input {
        padding-left: 32px;
    }

.form-control::placeholder {
    color: rgba(15,23,42,.55) !important;
    font-weight: 600;
}

/* GRID: editor daha geniş */
.cms-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.35fr; /* sağ panel daha geniş */
    gap: 14px;
}

/* Table */
.cms-table thead th {
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(15,23,42,.72);
    font-weight: 950;
    position: sticky;
    top: 0;
    background: #f9fafb;
    z-index: 2;
}

.cms-table tbody tr:hover {
    background: rgba(37,99,235,.04);
}

.cms-table tr.is-deleted {
    opacity: .82;
}

.thumb {
    width: 44px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
}

    .thumb.placeholder {
        display: grid;
        place-items: center;
        background: rgba(15,23,42,.05);
        color: rgba(15,23,42,.55);
    }

.page-title {
    font-weight: 950;
    color: rgba(15,23,42,.94);
    line-height: 1.2;
}

.page-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

    .page-meta .slug {
        font-size: 12px;
        color: rgba(15,23,42,.62);
        font-weight: 650;
    }

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
    display: grid;
    place-items: center;
    color: rgba(15,23,42,.78);
}

    .icon-btn:hover {
        background: rgba(37,99,235,.08);
        border-color: rgba(37,99,235,.22);
    }

/* Badges */
.badge-soft-success {
    background: rgba(34,197,94,.12);
    color: rgba(21,128,61,.98);
    border: 1px solid rgba(34,197,94,.22);
    font-weight: 800;
}

.badge-soft-warning {
    background: rgba(245,158,11,.16);
    color: rgba(146,64,14,.98);
    border: 1px solid rgba(245,158,11,.26);
    font-weight: 800;
}

.badge-soft-danger {
    background: rgba(220,38,38,.12);
    color: rgba(185,28,28,.98);
    border: 1px solid rgba(220,38,38,.22);
    font-weight: 800;
}

/* Empty */
.cms-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 10px;
    color: rgba(15,23,42,.68);
    font-weight: 700;
}

/* Editor */
.editor {
    position: sticky;
    top: 86px;
    height: fit-content;
}

.editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.editor-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tab {
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
    color: rgba(15,23,42,.80);
    padding: 8px 10px;
    border-radius: 999px;
    font-weight: 950;
    font-size: 12px;
}

    .tab.active {
        background: rgba(37,99,235,.12);
        border-color: rgba(37,99,235,.26);
        color: rgba(15,23,42,.96);
    }

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

/* Filter chip */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
    border: 1px solid rgba(15,23,42,.14);
    background: rgba(15,23,42,.03);
    color: rgba(15,23,42,.82);
}

    .filter-chip.success {
        background: rgba(34,197,94,.10);
        border-color: rgba(34,197,94,.22);
        color: rgba(21,128,61,.98);
    }

    .filter-chip.warning {
        background: rgba(245,158,11,.14);
        border-color: rgba(245,158,11,.26);
        color: rgba(146,64,14,.98);
    }

    .filter-chip.danger {
        background: rgba(220,38,38,.10);
        border-color: rgba(220,38,38,.22);
        color: rgba(185,28,28,.98);
    }

.chip-clear {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,.14);
    background: #fff;
    display: grid;
    place-items: center;
    color: rgba(15,23,42,.70);
}

    .chip-clear:hover {
        background: rgba(37,99,235,.06);
        border-color: rgba(37,99,235,.18);
    }

/* Segmented action group */
.action-group {
    display: inline-flex;
    align-items: stretch;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
}

    .action-group .action-btn {
        border: 0 !important;
        border-right: 1px solid rgba(15,23,42,.10);
        border-radius: 0 !important;
        background: transparent !important;
        font-weight: 850;
        padding: 8px 10px;
        color: rgba(15,23,42,.78);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

        .action-group .action-btn:last-child {
            border-right: 0;
        }

        .action-group .action-btn:hover {
            background: rgba(37,99,235,.06) !important;
        }

    .action-group .action-primary {
        color: rgba(37,99,235,.95) !important;
    }

    .action-group .action-success {
        color: rgba(21,128,61,.95) !important;
    }

    .action-group .action-warning {
        color: rgba(146,64,14,.95) !important;
    }

    .action-group .action-danger {
        color: rgba(185,28,28,.95) !important;
    }

        .action-group .action-danger:hover {
            background: rgba(185,28,28,.06) !important;
        }

    .action-group .action-warning:hover {
        background: rgba(245,158,11,.10) !important;
    }

    .action-group .action-success:hover {
        background: rgba(34,197,94,.10) !important;
    }

/* HTML Editor */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.html-editor {
    border: 1px solid rgba(15,23,42,.12);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.html-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: rgba(15,23,42,.03);
    border-bottom: 1px solid rgba(15,23,42,.10);
}

    .html-toolbar .tbtn {
        border: 1px solid rgba(15,23,42,.12);
        background: #fff;
        color: rgba(15,23,42,.78);
        border-radius: 12px;
        padding: 7px 10px;
        font-weight: 900;
        font-size: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 38px;
    }

        .html-toolbar .tbtn:hover {
            background: rgba(37,99,235,.06);
            border-color: rgba(37,99,235,.18);
        }

    .html-toolbar .sep {
        width: 1px;
        background: rgba(15,23,42,.10);
        margin: 0 2px;
    }

.html-surface {
    min-height: 340px;
    padding: 12px 12px 18px;
    outline: none;
    color: rgba(15,23,42,.92);
    font-weight: 600;
    line-height: 1.5;
}

    .html-surface:focus {
        box-shadow: inset 0 0 0 3px rgba(37,99,235,.10);
    }

/* Media */
.media-preview {
    margin-top: 10px;
    border: 1px dashed rgba(15,23,42,.22);
    background: rgba(15,23,42,.03);
    border-radius: 16px;
    overflow: hidden;
    min-height: 140px;
    display: grid;
    place-items: center;
}

    .media-preview img {
        width: 100%;
        max-height: 220px;
        object-fit: cover;
    }

    .media-preview .placeholder {
        display: flex;
        align-items: center;
        gap: 10px;
        color: rgba(15,23,42,.70);
        font-weight: 900;
    }

/* Responsive */
@media (max-width: 1200px) {
    .cms-grid {
        grid-template-columns: 1fr;
    }

    .editor {
        position: static;
    }
}

@media (max-width: 768px) {
    .cms-stats {
        grid-template-columns: 1fr 1fr;
    }

    .cms-filters {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}
