/*
 * Zevo Folio — yönetim paneli stilleri (Bootstrap 5.3 üzerine).
 * Grafit kenar çubuğu, açık içerik alanı, tek vurgu rengi.
 */

:root {
    --zf-accent: #5b5bd6;
    --zf-accent-rgb: 91, 91, 214;
    --zf-accent-soft: #ececfb;
    --zf-ink: #15171c;
    --zf-ink-2: #1e2128;
    --zf-ink-text: #a7adba;
    --zf-bg: #f5f6f8;
    --zf-line: #e6e8ec;
    --zf-radius: 12px;
    --bs-primary: var(--zf-accent);
    --bs-primary-rgb: var(--zf-accent-rgb);
    --bs-link-color: var(--zf-accent);
    --bs-link-color-rgb: var(--zf-accent-rgb);
    --bs-link-hover-color: #4646b8;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-font-size: .925rem;
    --bs-body-bg: var(--zf-bg);
    --bs-border-color: var(--zf-line);
    --bs-border-radius: 8px;
    --bs-border-radius-lg: var(--zf-radius);
    --bs-focus-ring-color: rgba(var(--zf-accent-rgb), .25);
}

body.admin {
    background: var(--zf-bg);
    color: #1d2027;
    -webkit-font-smoothing: antialiased;
}

.skip-link {
    position: absolute;
    z-index: 2000;
    top: 8px;
    left: 8px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
}

/* ------------------------------------------------------------ düğmeler */

.btn-primary {
    --bs-btn-bg: var(--zf-accent);
    --bs-btn-border-color: var(--zf-accent);
    --bs-btn-hover-bg: #4b4bc4;
    --bs-btn-hover-border-color: #4b4bc4;
    --bs-btn-active-bg: #4040b0;
    --bs-btn-active-border-color: #4040b0;
    --bs-btn-disabled-bg: var(--zf-accent);
    --bs-btn-disabled-border-color: var(--zf-accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--zf-accent);
    --bs-btn-border-color: var(--zf-accent);
    --bs-btn-hover-bg: var(--zf-accent);
    --bs-btn-hover-border-color: var(--zf-accent);
    --bs-btn-active-bg: var(--zf-accent);
}

.btn-light {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--zf-line);
    --bs-btn-hover-bg: #f0f1f4;
    --bs-btn-hover-border-color: #d8dbe1;
}

.btn .bi {
    vertical-align: -.1em;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(var(--zf-accent-rgb), .6);
    box-shadow: 0 0 0 .2rem rgba(var(--zf-accent-rgb), .18);
}

.form-check-input:checked {
    background-color: var(--zf-accent);
    border-color: var(--zf-accent);
}

.form-range::-webkit-slider-thumb {
    background: var(--zf-accent);
}

.form-range::-moz-range-thumb {
    background: var(--zf-accent);
}

.form-label {
    font-weight: 500;
    font-size: .86rem;
    margin-bottom: .3rem;
}

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

/* ------------------------------------------------------------ iskelet */

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

.admin-sidebar {
    /* Bootstrap .offcanvas-lg geniş ekranda arka planı !important ile şeffaf yapar */
    background: var(--zf-ink) !important;
    color: var(--zf-ink-text);
    width: 256px;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .admin-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
}

.admin-sidebar.offcanvas-lg {
    --bs-offcanvas-bg: var(--zf-ink);
    --bs-offcanvas-width: 272px;
}

@media (max-width: 991.98px) {
    .admin-sidebar.offcanvas-lg.show,
    .admin-sidebar.offcanvas-lg.showing {
        display: flex;
        flex-direction: column;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
}

.sidebar-brand .btn-close {
    filter: invert(1);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--zf-accent), #9b7bf0);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    color: #fff;
    font-size: .95rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-text small {
    color: #7d8494;
    font-size: .74rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 16px;
    scrollbar-width: thin;
    scrollbar-color: #2c3039 transparent;
}

.nav-group {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .68rem;
    font-weight: 600;
    color: #6b7180;
    padding: 16px 10px 6px;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    margin: 1px 0;
    border-radius: 8px;
    color: var(--zf-ink-text);
    text-decoration: none;
    font-size: .88rem;
    transition: background .15s, color .15s;
}

.sidebar-nav .nav-item .bi {
    font-size: 1.02rem;
    opacity: .85;
}

.sidebar-nav .nav-item:hover {
    background: var(--zf-ink-2);
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background: rgba(var(--zf-accent-rgb), .22);
    color: #fff;
}

.sidebar-nav .nav-item.active .bi {
    color: #b9b9ff;
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--zf-accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 1px 7px;
}

.sidebar-foot {
    padding: 12px 20px;
    border-top: 1px solid #23262e;
    color: #626877;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--zf-line);
    min-height: 58px;
}

.topbar-title {
    font-weight: 600;
    font-size: .95rem;
    color: #3a3f4a;
}

.avatar-xs {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--zf-accent-soft);
    color: var(--zf-accent);
    font-size: .72rem;
    font-weight: 700;
}

.admin-content {
    padding: 28px 28px 64px;
    max-width: 1320px;
    width: 100%;
}

@media (max-width: 575.98px) {
    .admin-content {
        padding: 18px 14px 56px;
    }

    .admin-topbar {
        padding: 8px 12px;
    }
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0;
}

.page-sub {
    color: #6b7180;
    margin: 4px 0 0;
    max-width: 760px;
    font-size: .88rem;
}

/* ------------------------------------------------------------ kartlar, tablolar */

.card {
    --bs-card-border-color: var(--zf-line);
    --bs-card-border-radius: var(--zf-radius);
    --bs-card-cap-bg: #fff;
    background: #fff;
}

.card.shadow-sm {
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04) !important;
}

.card-header {
    padding: 12px 18px;
    font-size: .9rem;
}

.card-title-sm {
    font-size: .95rem;
    font-weight: 600;
    margin: 0;
}

.data-table thead th {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #7a8090;
    font-weight: 600;
    background: #fafbfc;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.data-table td {
    font-size: .88rem;
}

.data-table > :not(caption) > * > * {
    padding: .65rem .9rem;
}

.thumb {
    width: 52px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f1f4;
    border: 1px solid var(--zf-line);
}

.thumb-round {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.col-drag {
    width: 34px;
}

.drag-handle {
    cursor: grab;
    color: #a0a6b2;
}

tr.dragging {
    opacity: .5;
    background: var(--zf-accent-soft);
}

.search-box {
    position: relative;
    min-width: 220px;
}

.search-box .bi {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0ac;
    font-size: .85rem;
}

.search-box input {
    padding-left: 30px;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #7a8090;
}

.empty-state > .bi {
    font-size: 2.4rem;
    color: #c4c8d2;
    display: block;
    margin-bottom: 8px;
}

/* yumuşak rozetler */
.badge[class*="badge-soft-"] {
    font-weight: 600;
    font-size: .72rem;
    padding: .35em .6em;
    border-radius: 6px;
}

.badge-soft-success { background: #e3f6ec; color: #13744a; }
.badge-soft-secondary { background: #eef0f3; color: #5c6270; }
.badge-soft-danger { background: #fde8e8; color: #b42318; }
.badge-soft-warning { background: #fff2d9; color: #94590a; }
.badge-soft-info { background: #e2f1fb; color: #155a8a; }
.badge-soft-primary { background: var(--zf-accent-soft); color: var(--zf-accent); }

.lang-chip {
    display: inline-block;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 1px 5px;
    border-radius: 4px;
    background: #eef0f3;
    color: #5c6270;
}

.nav-pills .nav-link.active .lang-chip {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--zf-accent);
}

.nav-underline {
    --bs-nav-underline-link-active-color: var(--zf-accent);
    border-bottom: 1px solid var(--zf-line);
    gap: 1.2rem;
}

.nav-underline .nav-link {
    color: #6b7180;
    font-size: .9rem;
}

/* ------------------------------------------------------------ form */

.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    background: linear-gradient(to top, var(--zf-bg) 75%, rgba(245, 246, 248, 0));
}

.image-field {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.image-field-preview {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--zf-line);
    background: #f3f4f6;
    flex-shrink: 0;
}

.image-field-preview.is-empty {
    display: grid;
    place-items: center;
    color: #b4b9c4;
    font-size: 1.5rem;
}

.color-field .form-control-color {
    max-width: 52px;
    padding: 4px;
}

.rich-editor {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.rich-editor:focus-within {
    border-color: rgba(var(--zf-accent-rgb), .6);
    box-shadow: 0 0 0 .2rem rgba(var(--zf-accent-rgb), .18);
}

.editor-toolbar {
    padding: 6px;
    border-bottom: 1px solid var(--zf-line);
    background: #fafbfc;
}

.editor-toolbar .btn {
    --bs-btn-padding-x: .45rem;
    --bs-btn-padding-y: .15rem;
}

.editor-toolbar .btn.active {
    background: var(--zf-accent-soft);
    color: var(--zf-accent);
}

.editor-area {
    min-height: 180px;
    max-height: 560px;
    overflow-y: auto;
    padding: 12px 14px;
    outline: none;
    line-height: 1.6;
}

.editor-area h2 {
    font-size: 1.3rem;
}

.editor-area h3 {
    font-size: 1.1rem;
}

.editor-area blockquote {
    border-left: 3px solid var(--zf-line);
    padding-left: 12px;
    color: #5c6270;
}

.rich-editor .editor-source {
    border: 0;
    border-radius: 0;
    min-height: 180px;
}

/* ------------------------------------------------------------ özet ve analiz */

.stat-card {
    padding: 16px 18px;
    height: 100%;
}

.stat-label {
    font-size: .78rem;
    color: #6b7180;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin-top: 4px;
}

.stat-foot {
    font-size: .76rem;
    color: #8a909c;
    margin-top: 2px;
}

.delta {
    font-size: .74rem;
    font-weight: 600;
    color: #8a909c;
}

.delta-up {
    color: #13744a;
}

.delta-down {
    color: #b42318;
}

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

.chart .grid {
    stroke: #eef0f3;
    stroke-width: 1;
}

.chart .axis {
    fill: #9aa0ac;
    font-size: 11px;
    font-family: inherit;
}

.chart .area {
    fill: rgba(var(--zf-accent-rgb), .12);
}

.chart .line {
    fill: none;
    stroke: var(--zf-accent);
    stroke-width: 2.2;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.chart .line-compare {
    fill: none;
    stroke: #b7bcc7;
    stroke-width: 1.6;
    stroke-dasharray: 5 4;
    vector-effect: non-scaling-stroke;
}

.chart .pt circle {
    fill: #fff;
    stroke: var(--zf-accent);
    stroke-width: 2;
    opacity: 0;
    transition: opacity .1s;
}

.chart .pt:hover circle {
    opacity: 1;
}

.chart .hit {
    fill: transparent;
}

.chart .bar {
    fill: rgba(var(--zf-accent-rgb), .75);
}

.chart .pt:hover .bar {
    fill: var(--zf-accent);
}

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

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

.bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: rgba(var(--zf-accent-rgb), .09);
    border-radius: 6px;
}

.bar-label {
    position: relative;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-value {
    position: relative;
    font-weight: 600;
    white-space: nowrap;
}

.bar-value small {
    color: #8a909c;
    font-weight: 500;
}

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

.checklist li {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--zf-line);
    font-size: .88rem;
}

.checklist li:last-child {
    border-bottom: 0;
}

.checklist .bi-check-circle-fill {
    color: #1a9a5f;
}

.checklist .bi-circle {
    color: #c4c8d2;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--zf-line);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    font-size: .88rem;
    transition: border-color .15s, transform .15s;
}

.quick-link:hover {
    border-color: rgba(var(--zf-accent-rgb), .5);
    transform: translateY(-1px);
}

.quick-link .bi {
    color: var(--zf-accent);
    font-size: 1.1rem;
}

.range-pills .btn {
    --bs-btn-padding-y: .25rem;
    --bs-btn-font-size: .82rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a9a5f;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(26, 154, 95, .6);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 8px rgba(26, 154, 95, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(26, 154, 95, 0);
    }
}

/* ------------------------------------------------------------ tasarım ekranı */

.theme-card {
    border: 2px solid var(--zf-line);
    border-radius: var(--zf-radius);
    overflow: hidden;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.theme-card.is-active {
    border-color: var(--zf-accent);
    box-shadow: 0 0 0 4px rgba(var(--zf-accent-rgb), .12);
}

.theme-swatch {
    height: 96px;
    display: flex;
    align-items: flex-end;
    padding: 12px;
    gap: 6px;
}

.theme-swatch span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .7);
}

.theme-swatch .ts-name {
    margin-right: auto;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.preset-btn i {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

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

.section-sorter li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--zf-line);
    border-radius: 8px;
    margin-bottom: 6px;
    background: #fff;
}

.section-sorter li.dragging {
    opacity: .5;
}

/* ------------------------------------------------------------ gelen kutusu */

.msg-row.is-unread td {
    font-weight: 600;
}

.msg-row.is-unread td:first-child {
    box-shadow: inset 3px 0 0 var(--zf-accent);
}

.msg-body {
    white-space: pre-wrap;
    background: #fafbfc;
    border: 1px solid var(--zf-line);
    border-radius: 10px;
    padding: 16px 18px;
    line-height: 1.6;
}

.reply-item {
    border-left: 3px solid var(--zf-accent);
    padding: 6px 0 6px 14px;
    margin-bottom: 14px;
}

.dl-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 6px 14px;
    margin: 0;
    font-size: .88rem;
}

.dl-grid dt {
    color: #6b7180;
    font-weight: 500;
}

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

/* ------------------------------------------------------------ giriş ekranı */

body.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
}

.auth-art {
    background:
        radial-gradient(circle at 20% 20%, rgba(155, 123, 240, .55), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(var(--zf-accent-rgb), .6), transparent 50%),
        var(--zf-ink);
    color: #fff;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-art h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.03em;
    max-width: 420px;
}

.auth-art p {
    color: #c5c9d6;
    max-width: 420px;
}

.auth-form {
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.auth-box {
    width: 100%;
    max-width: 380px;
}

.otp-input {
    font-size: 1.6rem;
    letter-spacing: .5em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
    body.auth {
        grid-template-columns: 1fr;
    }

    .auth-art {
        display: none;
    }
}

.code-box {
    font-family: ui-monospace, 'JetBrains Mono', monospace;
    background: #f3f4f6;
    border: 1px dashed #c4c8d2;
    border-radius: 8px;
    padding: 10px 12px;
    word-break: break-all;
    font-size: .9rem;
}

.log-view {
    background: var(--zf-ink);
    color: #d6dae3;
    font-size: .78rem;
    border-radius: 10px;
    padding: 14px;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.due-late {
    color: #b42318;
    font-weight: 600;
}

/* Yan yana alanların yanındaki anahtarlar, alanın alt çizgisine hizalanır */
@media (min-width: 768px) {
    .row > .toggle-field:not(.col-12) {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding-bottom: .4rem;
    }
}
