/* CIMUKA AI Data Training Panel — marka katmani (AdminLTE 3 uzerine) */
:root {
    --ck-brand: #afbf00;
    --ck-brand-dark: #96a400;
    --ck-brand-soft: rgba(175, 191, 0, .14);
    --ck-navy: #003793;
    --ck-navy-900: #04122f;
    --ck-navy-800: #0a1f4d;
    --ck-ink: #1f2532;
    --ck-muted: #626262;
    --ck-line: #e8ebef;
    --ck-bg: #f4f6f9;
    --ck-radius: 12px;
    --ck-shadow: 0 2px 10px rgba(4, 18, 47, .06);
    --ck-shadow-lg: 0 12px 32px rgba(4, 18, 47, .12);
    --ck-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

body,
.wrapper {
    font-family: var(--ck-font);
    color: var(--ck-ink);
    background: var(--ck-bg);
}

/* ---------- Sidebar ---------- */
.main-sidebar {
    background: linear-gradient(180deg, var(--ck-navy-900) 0%, var(--ck-navy-800) 100%);
    box-shadow: 2px 0 12px rgba(4, 18, 47, .18);
}

.main-sidebar .brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: .9rem 1rem;
    background: transparent;
}

.main-sidebar .brand-link .brand-image {
    max-height: 34px;
    width: auto;
    margin: 0 .6rem 0 0;
    opacity: 1;
    float: none;
    background: #fff;
    border-radius: 6px;
    padding: 3px 5px;
}

.main-sidebar .brand-text {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .2px;
    color: #fff;
    line-height: 1.1;
}

.main-sidebar .brand-text small {
    display: block;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ck-brand);
}

.nav-sidebar .nav-header {
    color: rgba(255, 255, 255, .42);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    padding: 1.1rem 1rem .45rem;
}

.nav-sidebar .nav-link {
    color: rgba(255, 255, 255, .74);
    border-radius: 8px;
    margin: 2px .55rem;
    padding: .58rem .75rem;
    font-size: .9rem;
    transition: background .15s ease, color .15s ease;
}

.nav-sidebar .nav-link .nav-icon {
    width: 1.3rem;
    font-size: .95rem;
    color: rgba(255, 255, 255, .55);
    transition: color .15s ease;
}

.nav-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.nav-sidebar .nav-link:hover .nav-icon {
    color: var(--ck-brand);
}

.nav-sidebar .nav-link.active,
.nav-sidebar .nav-link.active:hover {
    background: var(--ck-brand);
    color: var(--ck-navy-900);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(175, 191, 0, .3);
}

.nav-sidebar .nav-link.active .nav-icon {
    color: var(--ck-navy-900);
}

.nav-sidebar .badge-soon {
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .7);
    font-size: .56rem;
    font-weight: 700;
    letter-spacing: .2px;
    padding: .16rem .32rem;
    border-radius: 5px;
    white-space: nowrap;
}

.nav-sidebar .nav-link.active .badge-soon {
    background: rgba(4, 18, 47, .16);
    color: var(--ck-navy-900);
}

/* Ikon + baslik + rozet/ok tek satirda */
.nav-sidebar .nav-link {
    display: flex;
    align-items: center;
    width: auto;
    max-width: 100%;
}

.nav-sidebar .nav-link > .nav-icon {
    flex: 0 0 auto;
}

.nav-sidebar .nav-link > p {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: .4rem;
    margin: 0;
}

.nav-sidebar .nav-link > p > .nav-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-sidebar .nav-treeview .nav-link > p > .nav-text {
    overflow: visible;
    white-space: normal;
    line-height: 1.25;
}

.nav-sidebar .nav-link > p > .badge-soon,
.nav-sidebar .nav-link > p > .right {
    flex: 0 0 auto;
    float: none !important;
}

/* Sidebar daraltilinca yazilar gizlensin (AdminLTE animasyonu bozulmasin) */
.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-focused):not(:hover) .nav-sidebar .nav-link > p {
    flex: 0 0 0;
    min-width: 0;
    overflow: hidden;
}

/* Acilir-kapanir menu gruplari */
.nav-sidebar .nav-group {
    color: rgba(255, 255, 255, .8);
    font-weight: 600;
}

.nav-sidebar .nav-group.active,
.nav-sidebar .nav-group.active:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 700;
    box-shadow: none;
}

.nav-sidebar .nav-group.active .nav-icon {
    color: var(--ck-brand);
}

.nav-sidebar .nav-group .right {
    font-size: .8rem;
    color: rgba(255, 255, 255, .4);
    transition: transform .25s ease, color .15s ease;
}

.nav-sidebar .nav-group:hover .right,
.nav-sidebar .nav-group.active .right {
    color: var(--ck-brand);
}

.nav-sidebar .nav-treeview {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: .1rem 0 .35rem;
    padding-left: 1.05rem;
}

.main-sidebar .sidebar {
    overflow-x: hidden;
}

/* Dikey menude flex-wrap ikinci sutun acip satirlari geriyordu */
.nav-sidebar.flex-column {
    flex-wrap: nowrap;
}

.nav-sidebar > .nav-item,
.nav-sidebar .nav-treeview > .nav-item {
    min-width: 0;
}

.nav-sidebar .nav-treeview::before {
    content: "";
    position: absolute;
    top: .2rem;
    bottom: .2rem;
    left: 1rem;
    width: 1px;
    background: rgba(255, 255, 255, .12);
}

.nav-sidebar .nav-treeview .nav-link {
    margin: 2px .5rem 2px .25rem;
    padding: .46rem .55rem;
    font-size: .845rem;
}

.nav-sidebar .nav-treeview .nav-link .nav-icon {
    font-size: .85rem;
}

/* Sidebar daraltilinca acilan uc menude okunurluk */
.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar .nav-treeview::before {
    display: none;
}

.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-focused):not(:hover) .sidebar-footer {
    display: none;
}

.sidebar-footer {
    padding: 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .4);
    font-size: .72rem;
    line-height: 1.5;
}

/* ---------- Navbar ---------- */
.main-header.navbar {
    background: #fff;
    border-bottom: 1px solid var(--ck-line);
    box-shadow: var(--ck-shadow);
    min-height: 60px;
}

.main-header .nav-link {
    color: var(--ck-ink);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ck-brand);
    color: var(--ck-navy-900);
    font-weight: 700;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
}

.navbar-user .u-name {
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.15;
}

.navbar-user .u-role {
    font-size: .7rem;
    color: var(--ck-muted);
}

/* ---------- Basliklar ---------- */
.content-header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.2px;
}

.content-header .page-sub {
    color: var(--ck-muted);
    font-size: .85rem;
    margin-top: .15rem;
}

.breadcrumb-item a {
    color: var(--ck-navy);
}

/* ---------- Kartlar ---------- */
.card {
    border: 1px solid var(--ck-line);
    border-radius: var(--ck-radius);
    box-shadow: var(--ck-shadow);
}

.card-header {
    border-bottom: 1px solid var(--ck-line);
    background: #fff;
    border-radius: var(--ck-radius) var(--ck-radius) 0 0 !important;
    padding: .95rem 1.15rem;
}

.card-title {
    font-size: .95rem;
    font-weight: 700;
}

/* ---------- Istatistik kartlari ---------- */
.stat-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--ck-line);
    border-radius: var(--ck-radius);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--ck-shadow);
    height: 100%;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ck-shadow-lg);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--ck-brand);
}

.stat-card.is-muted::after {
    background: var(--ck-line);
}

.stat-card .stat-label {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--ck-muted);
}

.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: .3rem;
    color: var(--ck-navy-900);
}

.stat-card .stat-hint {
    font-size: .75rem;
    color: var(--ck-muted);
    margin-top: .2rem;
}

.stat-card .stat-icon {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.6rem;
    color: var(--ck-brand-soft);
}

/* ---------- Butonlar ---------- */
.btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: .86rem;
}

.btn-brand {
    background: var(--ck-brand);
    border-color: var(--ck-brand);
    color: var(--ck-navy-900);
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--ck-brand-dark);
    border-color: var(--ck-brand-dark);
    color: var(--ck-navy-900);
}

.btn-navy {
    background: var(--ck-navy);
    border-color: var(--ck-navy);
    color: #fff;
}

.btn-navy:hover {
    background: var(--ck-navy-800);
    border-color: var(--ck-navy-800);
    color: #fff;
}

/* ---------- Form ---------- */
.form-control,
.custom-select {
    border-radius: 8px;
    border-color: #d9dee5;
    font-size: .88rem;
    height: calc(2.4rem + 2px);
}

.form-control:focus {
    border-color: var(--ck-brand);
    box-shadow: 0 0 0 .2rem var(--ck-brand-soft);
}

label {
    font-size: .82rem;
    font-weight: 600;
    color: #3a4152;
}

/* ---------- Tablo ---------- */
.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--ck-line);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--ck-muted);
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: .87rem;
    border-top: 1px solid #f1f3f6;
}

.table-hover tbody tr:hover {
    background: #fafbf4;
}

.badge-role {
    font-size: .7rem;
    font-weight: 700;
    padding: .3rem .55rem;
    border-radius: 6px;
}

.badge-role.role-admin {
    background: var(--ck-navy);
    color: #fff;
}

.badge-role.role-operator {
    background: var(--ck-brand);
    color: var(--ck-navy-900);
}

.badge-role.role-viewer {
    background: #e9edf2;
    color: #4a5365;
}

.badge-state {
    font-size: .7rem;
    font-weight: 700;
    padding: .3rem .55rem;
    border-radius: 6px;
}

.badge-state.is-on {
    background: rgba(40, 167, 69, .12);
    color: #1e7e34;
}

.badge-state.is-off {
    background: rgba(220, 53, 69, .1);
    color: #c82333;
}

/* ---------- Bos durum / yol haritasi ---------- */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ck-muted);
}

.empty-state .es-icon {
    font-size: 2.4rem;
    color: #cfd6df;
    margin-bottom: .7rem;
}

.feature-list li {
    padding: .5rem 0;
    border-bottom: 1px dashed var(--ck-line);
    font-size: .88rem;
}

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

.feature-list li i {
    color: var(--ck-brand);
    margin-right: .5rem;
}

.phase-pill {
    display: inline-block;
    background: var(--ck-brand-soft);
    color: #6c7700;
    font-size: .74rem;
    font-weight: 700;
    padding: .3rem .6rem;
    border-radius: 6px;
}

/* ---------- Login ---------- */
.ck-login {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    margin: 0;
    font-family: var(--ck-font);
    background: var(--ck-bg);
}

.login-aside {
    flex: 1 1 46%;
    background:
        radial-gradient(1000px 520px at 8% -12%, rgba(175, 191, 0, .3), transparent 62%),
        linear-gradient(160deg, var(--ck-navy-900) 0%, #072052 55%, var(--ck-navy) 100%);
    color: #fff;
    padding: 3.2rem 3.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-aside::after {
    content: "";
    position: absolute;
    right: -160px;
    bottom: -180px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    border: 44px solid rgba(255, 255, 255, .04);
}

.login-aside .la-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ck-brand);
    border: 1px solid rgba(175, 191, 0, .4);
    border-radius: 30px;
    padding: .32rem .85rem;
}

.login-aside h2 {
    font-size: 2.05rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 1.4rem 0 .9rem;
    letter-spacing: -.4px;
}

.login-aside p.la-desc {
    color: rgba(255, 255, 255, .72);
    font-size: .95rem;
    line-height: 1.65;
    max-width: 430px;
}

.la-points {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
}

.la-points li {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .45rem 0;
    font-size: .88rem;
    color: rgba(255, 255, 255, .82);
}

.la-points i {
    color: var(--ck-brand);
    margin-top: .18rem;
}

.la-foot {
    font-size: .74rem;
    color: rgba(255, 255, 255, .4);
    position: relative;
    z-index: 1;
}

.login-main {
    flex: 1 1 54%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.login-box-ck {
    width: 100%;
    max-width: 410px;
}

.login-box-ck .lb-logo {
    max-width: 155px;
    margin-bottom: 1.9rem;
}

.login-box-ck h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.3px;
    margin-bottom: .3rem;
}

.login-box-ck .lb-sub {
    color: var(--ck-muted);
    font-size: .88rem;
    margin-bottom: 1.7rem;
}

.login-box-ck .form-group {
    margin-bottom: 1.05rem;
}

.login-box-ck .form-control {
    height: 46px;
    border-radius: 10px;
    padding-left: 2.6rem;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap > i {
    position: absolute;
    left: .95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa3b0;
    font-size: .9rem;
    pointer-events: none;
}

.input-icon-wrap .toggle-pass {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #9aa3b0;
    padding: .35rem .5rem;
    cursor: pointer;
}

.input-icon-wrap .toggle-pass:hover {
    color: var(--ck-navy);
}

.btn-login {
    height: 46px;
    width: 100%;
    border-radius: 10px;
    font-weight: 700;
    font-size: .92rem;
    background: var(--ck-brand);
    border-color: var(--ck-brand);
    color: var(--ck-navy-900);
    letter-spacing: .2px;
}

.btn-login:hover {
    background: var(--ck-brand-dark);
    border-color: var(--ck-brand-dark);
    color: var(--ck-navy-900);
}

.login-foot {
    margin-top: 1.8rem;
    font-size: .76rem;
    color: #9aa3b0;
    text-align: center;
    line-height: 1.6;
}

@media (max-width: 991.98px) {
    .login-aside {
        display: none;
    }
}

/* ---------- Cesitli ---------- */
.pagination .page-item.active .page-link {
    background: var(--ck-navy);
    border-color: var(--ck-navy);
}

.pagination .page-link {
    color: var(--ck-navy);
}

.main-footer {
    background: #fff;
    border-top: 1px solid var(--ck-line);
    font-size: .8rem;
    color: var(--ck-muted);
}

.alert {
    border-radius: 10px;
    border: 0;
    font-size: .88rem;
}

/* ---------- Bilgi Bankasi ---------- */
.badge-status {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .3px;
    padding: .28rem .5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-status.is-ok {
    background: rgba(40, 167, 69, .12);
    color: #1e7e34;
}

.badge-status.is-fail {
    background: rgba(220, 53, 69, .1);
    color: #c82333;
}

.badge-status.is-busy {
    background: rgba(0, 55, 147, .1);
    color: var(--ck-navy);
}

.badge-status.is-wait {
    background: var(--ck-brand-soft);
    color: #6c7700;
}

.badge-status.is-idle {
    background: #e9edf2;
    color: #4a5365;
}

.tag-pill {
    display: inline-block;
    background: #eef1f5;
    color: #4a5365;
    font-size: .68rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: 5px;
    margin: .25rem .25rem 0 0;
}

.source-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .88rem;
    line-height: 1.65;
    max-height: 420px;
    overflow-y: auto;
}

.chunk-row {
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--ck-line);
}

.chunk-row:last-child {
    border-bottom: 0;
}

.chunk-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .45rem;
}

.chunk-no {
    font-weight: 700;
    font-size: .8rem;
    color: var(--ck-navy);
}

.chunk-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .83rem;
    line-height: 1.6;
    color: #45505f;
    max-height: 190px;
    overflow-y: auto;
    background: #fafbfc;
    border: 1px solid var(--ck-line);
    border-radius: 8px;
    padding: .6rem .75rem;
}

.chunk-error {
    margin-top: .4rem;
    font-size: .78rem;
    color: #c82333;
}

.meta-table th {
    font-weight: 600;
    color: var(--ck-muted);
    font-size: .82rem;
    width: 42%;
    border-top: 0;
    padding-left: 0;
}

.meta-table td {
    font-size: .85rem;
    border-top: 0;
    padding-right: 0;
    text-align: right;
}

.meta-table tr + tr th,
.meta-table tr + tr td {
    border-top: 1px dashed var(--ck-line);
}

.code-block {
    background: var(--ck-navy-900);
    color: #d7e0ef;
    font-size: .76rem;
    line-height: 1.6;
    padding: .7rem .85rem;
    border-radius: 8px;
    margin-bottom: .75rem;
    overflow-x: auto;
}

/* ---------- Dokuman & klasor ---------- */
.dropzone {
    display: block;
    width: 100%;
    text-align: center;
    padding: 2.4rem 1rem;
    border: 2px dashed #cbd3dd;
    border-radius: var(--ck-radius);
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    margin: 0;
}

.dropzone:hover,
.dropzone.is-over {
    border-color: var(--ck-brand);
    background: var(--ck-brand-soft);
}

.dropzone i {
    font-size: 2.2rem;
    color: #b9c2ce;
    margin-bottom: .6rem;
}

.dropzone .dz-title {
    font-weight: 700;
    color: var(--ck-ink);
    margin-bottom: .3rem;
}

.dropzone .dz-hint {
    font-size: .8rem;
    color: var(--ck-muted);
    line-height: 1.6;
}

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

.file-list li {
    display: flex;
    align-items: center;
    font-size: .84rem;
    padding: .45rem .2rem;
    border-bottom: 1px dashed var(--ck-line);
}

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

.file-list .fl-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list .fl-size {
    flex: 0 0 auto;
    color: var(--ck-muted);
    margin-left: .75rem;
}

.folder-crumbs {
    font-size: .86rem;
    margin-bottom: 1rem;
    color: var(--ck-muted);
}

.folder-crumbs a {
    color: var(--ck-navy);
    font-weight: 600;
}

.folder-crumbs i {
    margin: 0 .45rem;
    color: #c3ccd8;
    font-size: .75rem;
}

.folder-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--ck-line);
    border-radius: var(--ck-radius);
    padding: 1rem;
    height: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.folder-card:hover {
    border-color: var(--ck-brand);
    box-shadow: var(--ck-shadow);
}

.folder-card .fc-main {
    display: block;
    color: inherit;
    text-decoration: none;
}

.folder-card .fc-main > i {
    font-size: 1.7rem;
    color: var(--ck-brand);
}

.folder-card .fc-name {
    font-weight: 700;
    font-size: .9rem;
    margin-top: .5rem;
    word-break: break-word;
}

.folder-card .fc-meta {
    font-size: .76rem;
    color: var(--ck-muted);
}

.folder-card .fc-actions {
    margin-top: .6rem;
}

.folder-card .fc-lock {
    position: absolute;
    top: .8rem;
    right: .9rem;
    color: #b9c2ce;
    font-size: .8rem;
}

/* ---------- Soru - Cevap ---------- */
.qa-row {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ck-line);
}

.qa-row:last-child {
    border-bottom: 0;
}

.qa-head {
    display: flex;
    align-items: flex-start;
    gap: .25rem;
}

.qa-question {
    font-weight: 700;
    font-size: .92rem;
    color: var(--ck-navy-900);
    flex: 1 1 auto;
    min-width: 0;
}

.qa-answer {
    margin-top: .4rem;
    font-size: .85rem;
    line-height: 1.6;
    color: #45505f;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 140px;
    overflow-y: auto;
}

.qa-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: .5rem;
    font-size: .76rem;
}

/* ---------- AI Chat ---------- */
.chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 230px);
    min-height: 420px;
}

.chat-stream {
    flex: 1 1 auto;
    overflow-y: auto;
    background: #f7f9fb;
}

.chat-session {
    display: block;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--ck-line);
    color: inherit;
    text-decoration: none;
}

.chat-session:hover {
    background: #fafbf4;
    color: inherit;
    text-decoration: none;
}

.chat-session.is-active {
    background: var(--ck-brand-soft);
    border-left: 3px solid var(--ck-brand);
}

.chat-session .cs-title {
    font-size: .84rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-session .cs-meta {
    font-size: .72rem;
    color: var(--ck-muted);
}

.chat-msg {
    margin-bottom: 1.1rem;
    max-width: 82%;
}

.chat-msg.is-user {
    margin-left: auto;
}

.chat-msg .cm-bubble {
    padding: .7rem .9rem;
    border-radius: 12px;
    font-size: .875rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-msg.is-user .cm-bubble {
    background: var(--ck-navy);
    color: #fff;
    border-bottom-right-radius: 3px;
}

.chat-msg.is-bot .cm-bubble {
    background: #fff;
    border: 1px solid var(--ck-line);
    border-bottom-left-radius: 3px;
}

.chat-msg.is-pending .cm-bubble {
    color: var(--ck-muted);
    font-style: italic;
}

.chat-msg.is-error .cm-bubble {
    background: rgba(220, 53, 69, .06);
    border-color: rgba(220, 53, 69, .3);
    color: #c82333;
}

.cm-citations {
    margin-top: .45rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.cm-citations .cite {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .76rem;
    color: #45505f;
    background: #fff;
    border: 1px solid var(--ck-line);
    border-radius: 7px;
    padding: .3rem .5rem;
    text-decoration: none;
}

.cm-citations a.cite:hover {
    border-color: var(--ck-brand);
    color: var(--ck-navy);
    text-decoration: none;
}

.cm-citations .cite-no {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    line-height: 17px;
    text-align: center;
    border-radius: 4px;
    background: var(--ck-brand);
    color: var(--ck-navy-900);
    font-weight: 700;
    font-size: .66rem;
}

.cm-citations .cite-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-citations .cite-src {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--ck-muted);
    font-size: .7rem;
}

.cm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .35rem;
    font-size: .72rem;
    color: var(--ck-muted);
}

.rate-btn {
    background: none;
    border: 0;
    color: #b9c2ce;
    padding: 0 .25rem;
    cursor: pointer;
}

.rate-btn:hover {
    color: var(--ck-navy);
}

.rate-btn.is-on {
    color: #1e7e34;
}

.rate-btn.is-off {
    color: #c82333;
}

.chat-welcome {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--ck-muted);
}

.chat-welcome i {
    font-size: 2.8rem;
    color: #cfd6df;
    margin-bottom: .9rem;
}

.chat-welcome h5 {
    font-weight: 700;
    color: var(--ck-ink);
}

.chat-welcome p {
    font-size: .86rem;
    max-width: 460px;
    margin: .5rem auto 0;
    line-height: 1.65;
}

.chat-input {
    display: flex;
    gap: .6rem;
    align-items: flex-end;
}

.chat-input textarea {
    resize: none;
}

.chat-input .btn {
    flex: 0 0 auto;
    height: 42px;
    width: 48px;
}

/* ---------- Onay kuyrugu ---------- */
.approval-tabs .nav-link {
    color: var(--ck-muted);
    font-weight: 600;
    font-size: .86rem;
    border-radius: 8px;
}

.approval-tabs .nav-link.active {
    background: var(--ck-navy);
    color: #fff;
}

.approval-question {
    margin: 0;
    padding: .7rem .9rem;
    background: #f7f9fb;
    border-left: 3px solid var(--ck-brand);
    border-radius: 0 8px 8px 0;
    font-size: .9rem;
    line-height: 1.6;
}

/* ---------- Log ve puanlama ekranlari ---------- */
.log-row {
    padding: .7rem 1.25rem;
    border-bottom: 1px solid var(--ck-line);
}

.log-row:last-child {
    border-bottom: 0;
}

.log-head {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.log-channel {
    font-size: .72rem;
    color: var(--ck-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.log-message {
    font-size: .84rem;
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.log-context summary {
    cursor: pointer;
    font-size: .76rem;
    color: var(--ck-navy);
    margin-top: .4rem;
}

.log-context pre {
    margin-top: .4rem;
    background: #fafbfc;
    border: 1px solid var(--ck-line);
    border-radius: 8px;
    padding: .6rem .75rem;
    font-size: .72rem;
    line-height: 1.55;
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.rating-mark {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 6px;
    font-size: .72rem;
    margin-right: .5rem;
}

.rating-mark.is-up {
    background: rgba(40, 167, 69, .12);
    color: #1e7e34;
}

.rating-mark.is-down {
    background: rgba(220, 53, 69, .1);
    color: #c82333;
}

.mail-preview {
    border: 1px solid var(--ck-line);
    border-radius: 8px;
    padding: .9rem 1rem;
    background: #fafbfc;
    font-size: .84rem;
    line-height: 1.6;
}

.mail-preview .mp-subject {
    font-weight: 700;
    color: var(--ck-navy-900);
    padding-bottom: .5rem;
    margin-bottom: .6rem;
    border-bottom: 1px solid var(--ck-line);
}

.mail-preview .mp-greeting {
    margin-bottom: .6rem;
}

.mail-preview .mp-question {
    padding: .5rem .7rem;
    background: #fff;
    border-left: 3px solid var(--ck-brand);
    border-radius: 0 6px 6px 0;
    margin-bottom: .7rem;
    font-size: .8rem;
}

.mail-preview .mp-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.mail-preview .mp-footer {
    margin-top: .8rem;
    padding-top: .6rem;
    border-top: 1px solid var(--ck-line);
    font-size: .76rem;
    color: var(--ck-muted);
    white-space: pre-wrap;
}
