/*
 * Zevo Ajans — yönetim paneli (Bootstrap 5 üzerine).
 */

:root {
    --a-bg: #f4f4f1;
    --a-surface: #ffffff;
    --a-text: #17171d;
    --a-muted: #6c6c78;
    --a-line: #e6e5e0;
    --a-side: #101015;
    --a-side-text: #c9c8d3;
    --a-accent: #5b3df5;
    --a-lime: #c8ff3d;
    --bs-primary: #5b3df5;
    --bs-primary-rgb: 91, 61, 245;
    --bs-link-color: #4a2fe0;
    --bs-link-color-rgb: 74, 47, 224;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-bg: var(--a-bg);
    --bs-border-color: var(--a-line);
    --bs-border-radius: 10px;
}

body.admin {
    background: var(--a-bg);
    color: var(--a-text);
    font-size: .94rem;
}

.btn-primary {
    --bs-btn-bg: #5b3df5;
    --bs-btn-border-color: #5b3df5;
    --bs-btn-hover-bg: #4a2fe0;
    --bs-btn-hover-border-color: #4a2fe0;
    --bs-btn-active-bg: #3f27c5;
}

.btn-outline-primary {
    --bs-btn-color: #5b3df5;
    --bs-btn-border-color: #5b3df5;
    --bs-btn-hover-bg: #5b3df5;
    --bs-btn-hover-border-color: #5b3df5;
}

.text-bg-primary {
    background-color: #5b3df5 !important;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
}

.shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

/* ------------------------------------------------------------------ sol menü */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--a-side);
    color: var(--a-side-text);
    z-index: 1040;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    color: #fff;
    text-decoration: none;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--a-lime);
    color: #101015;
    font-size: 18px;
    flex-shrink: 0;
}

.brand-text strong {
    display: block;
    font-size: .98rem;
    line-height: 1.2;
}

.brand-text small {
    opacity: .55;
    font-size: .75rem;
}

.menu {
    flex: 1;
    overflow-y: auto;
    padding: 6px 12px 20px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a33 transparent;
}

.menu-title {
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #75747f;
    padding: 16px 10px 6px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--a-side-text);
    text-decoration: none;
    font-size: .89rem;
}

.menu a .bi {
    font-size: 1rem;
    opacity: .85;
}

.menu a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.menu a.active {
    background: rgba(200, 255, 61, .12);
    color: var(--a-lime);
}

.menu .count {
    margin-left: auto;
    background: var(--a-lime);
    color: #101015;
    border-radius: 999px;
    font-size: .7rem;
    padding: 1px 7px;
}

.sidebar-foot {
    display: flex;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #22222a;
    font-size: .8rem;
}

.sidebar-foot a {
    color: var(--a-side-text);
    text-decoration: none;
}

.sidebar-backdrop {
    display: none;
}

/* ------------------------------------------------------------------ üst çubuk */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 28px;
    background: rgba(244, 244, 241, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--a-line);
}

.topbar-search {
    align-items: center;
    gap: 8px;
    background: var(--a-surface);
    border: 1px solid var(--a-line);
    border-radius: 10px;
    padding: 0 12px;
    width: min(380px, 40vw);
}

.topbar-search input {
    border: 0;
    outline: 0;
    padding: 8px 0;
    width: 100%;
    background: transparent;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar .dot {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #ef4444;
    color: #fff;
    font-size: .62rem;
    border-radius: 999px;
    padding: 0 5px;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: none;
    padding: 4px;
    text-align: left;
}

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--a-text);
    color: var(--a-lime);
    font-weight: 700;
}

.user-name {
    font-weight: 600;
    line-height: 1.15;
}

.user-name small {
    display: block;
    font-weight: 400;
    color: var(--a-muted);
    font-size: .76rem;
}

.demo-strip {
    background: #fff7d6;
    padding: 8px 28px;
    font-size: .86rem;
    border-bottom: 1px solid #f1e3a8;
}

.content {
    padding: 26px 28px 60px;
    max-width: 1500px;
}

/* ------------------------------------------------------------------ sayfa başlığı ve kartlar */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 22px;
}

.page-head h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.page-head p {
    margin: 4px 0 0;
    color: var(--a-muted);
}

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

.card {
    border: 1px solid var(--a-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

.card-header {
    background: transparent;
    border-bottom-color: var(--a-line);
    font-weight: 600;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-body {
    padding: 18px;
}

.admin-table {
    margin: 0;
}

.admin-table thead th {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--a-muted);
    font-weight: 600;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.admin-table td {
    vertical-align: middle;
}

.w-sort {
    width: 90px;
}

.thumb {
    width: 64px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--a-bg);
}

.thumb-empty {
    display: inline-grid;
    place-items: center;
    color: var(--a-muted);
}

.empty-box {
    text-align: center;
    padding: 48px 20px;
    color: var(--a-muted);
}

.empty-box .bi {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 8px;
}

.admin-tabs .nav-link {
    color: var(--a-muted);
    font-weight: 500;
}

.admin-tabs .nav-link.active {
    color: var(--a-text);
    font-weight: 600;
}

.form-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px 0;
    margin-top: 18px;
    background: linear-gradient(transparent, var(--a-bg) 30%);
}

.form-label {
    font-weight: 600;
    font-size: .86rem;
    margin-bottom: 5px;
}

.form-text {
    font-size: .78rem;
}

.img-preview img {
    max-width: 220px;
    max-height: 140px;
    border-radius: 10px;
    border: 1px solid var(--a-line);
    object-fit: cover;
    display: block;
}

.gallery-edit {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-item {
    position: relative;
    width: 140px;
    cursor: grab;
}

.gallery-item img {
    width: 140px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--a-line);
}

.gallery-item .btn {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 0 6px;
}

.gallery-item.is-dragging {
    opacity: .4;
}

.repeater-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.color-input .form-control-color {
    max-width: 54px;
}

/* Zengin metin düzenleyici */
.editor {
    border: 1px solid var(--a-line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.editor-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px;
    border-bottom: 1px solid var(--a-line);
    background: #fafaf8;
}

.editor-bar .btn {
    border: 0;
    padding: 4px 8px;
}

.editor-bar .btn:hover,
.editor-bar .btn.active {
    background: #ecebf8;
}

.editor-area {
    min-height: 220px;
    max-height: 640px;
    overflow-y: auto;
    padding: 14px 16px;
    outline: 0;
}

.editor-area:empty::before {
    content: attr(data-placeholder);
    color: var(--a-muted);
}

.editor .editor-source {
    display: none;
    border: 0;
    border-radius: 0;
    font-family: ui-monospace, Consolas, monospace;
    font-size: .82rem;
}

.editor.is-code .editor-source {
    display: block;
}

.editor.is-code .editor-area {
    display: none;
}

.prose-admin h2 {
    font-size: 1.35rem;
}

.prose-admin h3 {
    font-size: 1.12rem;
}

.prose-admin img {
    max-width: 100%;
    border-radius: 8px;
}

.prose-admin blockquote {
    border-left: 3px solid var(--a-accent);
    padding-left: 12px;
    color: var(--a-muted);
}

/* ------------------------------------------------------------------ özet ve analitik */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi {
    background: var(--a-surface);
    border: 1px solid var(--a-line);
    border-radius: 14px;
    padding: 16px 18px;
}

.kpi-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--a-muted);
    font-size: .8rem;
}

.kpi-value {
    display: block;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 4px;
}

.kpi-delta {
    font-size: .78rem;
    font-weight: 600;
}

.kpi-delta.up {
    color: #15803d;
}

.kpi-delta.down {
    color: #dc2626;
}

.chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart text {
    font-size: 11px;
    fill: var(--a-muted);
}

.chart .grid line {
    stroke: var(--a-line);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: .8rem;
    color: var(--a-muted);
}

.legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: -1px;
}

.bar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bar-list li {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    margin-bottom: 4px;
    border-radius: 8px;
    overflow: hidden;
    font-size: .86rem;
}

.bar-list li span,
.bar-list li b {
    position: relative;
    z-index: 1;
}

.bar-list li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-list li::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--w, 0%);
    background: rgba(91, 61, 245, .09);
}

.heatmap {
    display: grid;
    grid-template-columns: 40px repeat(24, minmax(0, 1fr));
    gap: 2px;
    font-size: .68rem;
    color: var(--a-muted);
}

.heatmap span {
    aspect-ratio: 1;
    border-radius: 3px;
    background: rgba(91, 61, 245, var(--o, 0));
    outline: 1px solid rgba(0, 0, 0, .03);
}

.funnel-step {
    margin-bottom: 12px;
}

.funnel-bar {
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(90deg, #5b3df5, #8b74ff);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-weight: 600;
    font-size: .82rem;
    min-width: 46px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .2);
    display: inline-block;
}

/* Talep panosu */
.kanban {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.kanban-col {
    background: #ebeae5;
    border-radius: 12px;
    padding: 10px;
    min-height: 200px;
}

.kanban-col h3 {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    display: flex;
    justify-content: space-between;
    margin: 4px 4px 10px;
}

.kanban-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--a-text);
    border: 1px solid var(--a-line);
    font-size: .85rem;
}

.kanban-card:hover {
    border-color: var(--a-accent);
    color: var(--a-text);
}

.kanban-card strong {
    display: block;
}

.kanban-card small {
    color: var(--a-muted);
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline li {
    position: relative;
    padding: 0 0 16px 22px;
    border-left: 2px solid var(--a-line);
    margin-left: 6px;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--a-accent);
}

.timeline li.is-system::before {
    border-color: var(--a-muted);
}

.dl-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px 14px;
    margin: 0;
}

.dl-grid dt {
    color: var(--a-muted);
    font-weight: 500;
}

.dl-grid dd {
    margin: 0;
    word-break: break-word;
}

.theme-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.theme-pick label {
    display: block;
    border: 2px solid var(--a-line);
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    background: #fff;
}

.theme-pick input {
    position: absolute;
    opacity: 0;
}

.theme-pick label:has(input:checked) {
    border-color: var(--a-accent);
    box-shadow: 0 0 0 3px rgba(91, 61, 245, .15);
}

.palette-swatch {
    display: flex;
    height: 30px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.palette-swatch span {
    flex: 1;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.palette-grid label {
    border: 2px solid var(--a-line);
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    font-size: .8rem;
    background: #fff;
}

.palette-grid input {
    position: absolute;
    opacity: 0;
}

.palette-grid label:has(input:checked) {
    border-color: var(--a-accent);
}

.sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sortable-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--a-line);
    border-radius: 10px;
    margin-bottom: 6px;
    background: #fff;
    cursor: grab;
}

.sortable-list li.is-dragging {
    opacity: .5;
}

.drag-handle {
    color: var(--a-muted);
}

/* Giriş */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 20% 20%, rgba(91, 61, 245, .18), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(200, 255, 61, .2), transparent 40%),
        var(--a-bg);
}

.auth-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--a-line);
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .25);
}

.auth-card .brand-mark {
    margin-bottom: 16px;
}

/* ------------------------------------------------------------------ duyarlı */

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 270px;
        transform: translateX(-100%);
        transition: transform .25s;
    }

    body.sidebar-open .sidebar {
        transform: none;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 1035;
    }

    .content {
        padding: 18px 14px 60px;
    }

    .topbar {
        padding: 10px 14px;
    }

    .dl-grid {
        grid-template-columns: 1fr;
    }
}
