/* =============================================================
   KalitePusula — Global Stiller
   ============================================================= */

:root {
    --quartz:         #00A4AC;
    --quartz-dark:    #00838A;
    --quartz-light:   #E6F7F8;
    --quartz-xlight:  #F0FAFB;
    --sidebar-w:      260px;
    --topbar-h:       60px;
    --text-muted-q:   #6c757d;
    --border-color:   #e9ecef;
    --shadow-sm:      0 1px 4px rgba(0,0,0,.07);
    --shadow-md:      0 4px 16px rgba(0,0,0,.10);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: #f4f6f9;
    color: #2d3748;
    margin: 0;
    overflow-x: hidden;
}

a { color: var(--quartz); text-decoration: none; }
a:hover { color: var(--quartz-dark); }

/* ============================================================
   AUTH / GİRİŞ SAYFASI
   ============================================================ */
/* Product identity: KalitePusula brand tokens (kalitepusula.com theme: navy, teal, teal-ink, mineral, mist, sand, line). */
.kp-auth-body {
    --kp-navy:      #0B2D4A;
    --kp-deep:      #071E30;
    --kp-teal:      #14B8A6;
    --kp-teal-ink:  #087F78;
    --kp-mineral:   #3E6B87;
    --kp-mist:      #E7EEF2;
    --kp-sand:      #F8FAFB;
    --kp-line:      #D3DEE5;
    --kp-on-navy:   #B4C6D2;
    margin: 0;
    background: #EEF3F6;
    color: var(--kp-navy);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Desktop: full-height split screen. Left: brand panel (logo on top, the message and the three areas centred as one
   group, so no large empty band); right: a wide form on white with the footer at the bottom. */
.kp-auth-page { min-height: 100vh; }
.kp-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    background: #fff;
}

.kp-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: clamp(2.5rem, 5vh, 3.5rem) clamp(2.5rem, 5vw, 5.5rem);
    color: #fff;
    background:
        radial-gradient(circle at 85% 18%, rgba(20, 184, 166, .26) 0, rgba(20, 184, 166, 0) 40%),
        radial-gradient(circle at 10% 95%, rgba(62, 107, 135, .50) 0, rgba(62, 107, 135, 0) 45%),
        linear-gradient(160deg, var(--kp-navy) 0%, var(--kp-deep) 100%);
}
.kp-auth-logo { display: inline-flex; align-items: center; gap: .7rem; color: #fff; }
.kp-auth-mark { width: 42px; height: auto; flex: none; }
.kp-auth-wordmark { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }

.kp-auth-brand-body { max-width: 34rem; margin-top: auto; }
.kp-auth-eyebrow {
    margin: 0 0 1rem;
    color: var(--kp-teal);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.kp-auth-headline { margin: 0 0 1rem; font-size: clamp(1.9rem, 2.7vw, 2.75rem); font-weight: 700; line-height: 1.18; letter-spacing: -.025em; color: #fff; }
.kp-auth-lead { margin: 0; max-width: 30rem; color: var(--kp-on-navy); font-size: 1.05rem; line-height: 1.6; }
.kp-auth-mobile-title, .kp-auth-mobile-text { display: none; }

.kp-auth-features { list-style: none; margin: 0 0 auto; padding: 0; display: grid; gap: .75rem; max-width: 34rem; }
.kp-auth-features li {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1rem;
    border: 1px solid rgba(180, 198, 210, .18);
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
}
.kp-auth-features strong { display: block; font-size: .95rem; font-weight: 600; color: #fff; }
.kp-auth-features li span span { display: block; margin-top: .1rem; color: var(--kp-on-navy); font-size: .84rem; }
.kp-auth-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    background: rgba(20, 184, 166, .16);
    color: var(--kp-teal);
    font-size: 1.1rem;
}

.kp-auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(2rem, 5vh, 3.5rem) clamp(1.5rem, 5vw, 4rem) 1.75rem;
    background: #fff;
}
.kp-auth-card { width: 100%; max-width: 27rem; margin: auto 0; }
.kp-auth-title { margin: 0 0 .4rem; font-size: 2rem; font-weight: 700; letter-spacing: -.025em; color: var(--kp-navy); }
.kp-auth-subtitle { margin: 0 0 2rem; color: var(--kp-mineral); font-size: 1rem; }

.kp-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: 1.25rem;
    overflow-wrap: anywhere;
}
.kp-auth-alert .bi { margin-top: .15rem; }

.kp-auth-field { margin-bottom: 1.2rem; }
.kp-auth-field .form-label { margin-bottom: .45rem; font-size: .875rem; font-weight: 600; color: var(--kp-navy); }
.kp-auth-input {
    min-height: 3.1rem;
    border: 1px solid var(--kp-line);
    border-radius: 12px;
    background: var(--kp-sand);
    color: var(--kp-navy);
    font-size: 1rem;
}
.kp-auth-input::placeholder { color: #8A9BAA; }
.kp-auth-input:focus {
    background: #fff;
    border-color: var(--kp-teal-ink);
    box-shadow: 0 0 0 .2rem rgba(8, 127, 120, .18);
}
.kp-auth-password { position: relative; }
.kp-auth-password .kp-auth-input { padding-right: 3.25rem; }
.kp-auth-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--kp-mineral);
    font-size: 1.1rem;
}
.kp-auth-toggle:hover { background: var(--kp-mist); color: var(--kp-navy); }

.kp-auth-submit {
    min-height: 3.1rem;
    margin-top: .4rem;
    border: 0;
    border-radius: 12px;
    background: var(--kp-navy);
    color: #fff;
    font-weight: 600;
    transition: background-color .15s ease;
}
.kp-auth-submit:hover, .kp-auth-submit:focus { background: var(--kp-mineral); color: #fff; }

.kp-auth-body :focus-visible { outline: 2px solid var(--kp-teal-ink); outline-offset: 2px; }
.kp-auth-brand :focus-visible { outline-color: var(--kp-teal); }

.kp-auth-footer { margin: 1.5rem 0 0; color: var(--kp-mineral); font-size: .8rem; }

/* Tablet and phone: the same split, stacked. Compact brand panel (logo, short message, the three areas as small
   chips), the form card right below, footer inside the card. Small screens do not force a full viewport height. */
@media (max-width: 991.98px) {
    .kp-auth-page { display: block; min-height: 0; padding: 1.5rem 1rem; }
    .kp-auth { grid-template-columns: 1fr; max-width: 32rem; min-height: 0; margin: 0 auto; border-radius: 20px; overflow: hidden; box-shadow: 0 1px 0 rgba(11, 45, 74, .06), 0 28px 56px -32px rgba(11, 45, 74, .45); }
    .kp-auth-brand { gap: .9rem; padding: 1.35rem 1.5rem 1.4rem; background: radial-gradient(circle at 92% 0%, rgba(20, 184, 166, .28) 0, rgba(20, 184, 166, 0) 45%), linear-gradient(160deg, var(--kp-navy) 0%, var(--kp-deep) 100%); }
    .kp-auth-mark { width: 32px; }
    .kp-auth-wordmark { font-size: 1.15rem; }
    .kp-auth-brand-body { margin-top: 0; }
    .kp-auth-eyebrow, .kp-auth-headline, .kp-auth-lead { display: none; }
    .kp-auth-mobile-title { display: block; margin: 0 0 .3rem; font-size: 1.05rem; font-weight: 700; color: #fff; }
    .kp-auth-mobile-text { display: block; margin: 0; font-size: .85rem; line-height: 1.5; color: var(--kp-on-navy); }
    .kp-auth-features { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
    .kp-auth-features li { gap: .35rem; padding: .28rem .6rem; border-radius: 999px; }
    .kp-auth-feature-icon { width: auto; height: auto; background: transparent; font-size: .8rem; }
    .kp-auth-features strong { font-size: .74rem; font-weight: 600; }
    .kp-auth-features li span span { display: none; }
    .kp-auth-main { display: block; padding: 1.5rem 1.5rem 0; background: var(--kp-sand); }
    .kp-auth-card { max-width: none; margin: 0; }
    .kp-auth-title { font-size: 1.4rem; }
    .kp-auth-subtitle { margin-bottom: 1.25rem; font-size: .95rem; }
    .kp-auth-footer { margin-top: 1.5rem; padding: 1rem 0 1.1rem; border-top: 1px solid var(--kp-line); text-align: center; }
}
@media (max-width: 575.98px) {
    .kp-auth-page { padding: .75rem .75rem 1rem; }
    .kp-auth { border-radius: 16px; }
    .kp-auth-brand { padding: 1.15rem 1.25rem 1.2rem; }
    .kp-auth-main { padding: 1.25rem 1.25rem 0; }
}

@media (prefers-reduced-motion: reduce) {
    .kp-auth-submit, .kp-auth-toggle { transition: none; }
}

.form-control:focus, .form-select:focus {
    border-color: var(--quartz);
    box-shadow: 0 0 0 .2rem rgba(0,164,172,.2);
}

.btn-quartz {
    background: var(--quartz);
    border-color: var(--quartz);
    color: #fff;
    font-weight: 600;
    transition: background .2s, border-color .2s;
}
.btn-quartz:hover, .btn-quartz:focus {
    background: var(--quartz-dark);
    border-color: var(--quartz-dark);
    color: #fff;
}
.btn-quartz:disabled { background: #8dcfd2; border-color: #8dcfd2; }

/* ============================================================
   LAYOUT — SIDEBAR + CONTENT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--kp-navy) 0%, var(--kp-deep) 100%);
    position: fixed;
    top: 0; left: 0;
    z-index: 1040;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    min-height: 72px;
    padding: 1.1rem 1.1rem .9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
}

.sidebar-brand-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(17,181,191,.22));
    background: #fff;
    border-radius: 6px;
    padding: 3px;
}

.sidebar-brand-logo {
    width: auto;
    height: 38px;
    max-width: 140px;
    object-fit: contain;
}

.sidebar-profile {
    margin: 1rem 1rem 0;
    padding: .95rem 1rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: .85rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
}

.sidebar-profile-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #58c7ff 0%, #3e8eff 100%);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}

.sidebar-profile-name {
    color: #fff;
    font-size: .94rem;
    font-weight: 700;
}

.sidebar-profile-role {
    color: rgba(255,255,255,.54);
    font-size: .74rem;
    text-transform: capitalize;
}

.sidebar-quickbar {
    margin: .8rem 1rem 0;
    padding: .55rem;
    border-radius: 18px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: .5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar-quickbar::-webkit-scrollbar {
    display: none;
}

.sidebar-quickbar-item {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.86);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    transition: all .16s ease;
    text-decoration: none;
}

.sidebar-quickbar-item:hover {
    color: #fff;
    border-color: rgba(57,199,208,.58);
    background: rgba(57,199,208,.18);
}

.sidebar-quickbar-item.active {
    color: #fff;
    border-color: #39c7d0;
    background: rgba(57,199,208,.24);
}

.sidebar-quickbar-item.is-placeholder,
.sidebar-quickbar-item:disabled {
    opacity: .52;
    cursor: not-allowed;
}

.sidebar-quickbar-item.is-placeholder:hover,
.sidebar-quickbar-item:disabled:hover {
    color: rgba(255,255,255,.86);
    border-color: rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
}

.sidebar-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: .75rem;
    -webkit-overflow-scrolling: touch;
}

.sidebar-sections {
    padding: .9rem 0 1rem;
    min-height: 0;
}

.sidebar-section + .sidebar-section {
    margin-top: .9rem;
}

.sidebar-tree-section + .sidebar-tree-section {
    margin-top: .15rem;
}

.sidebar-parent {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 46px;
    width: 100%;
    padding: 0 .9rem 0 0;
    background: transparent;
    outline: 0;
    box-shadow: none;
    border-left: 0;
    border-right: 0;
    color: rgba(255,255,255,.84);
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
    border-top: 1px solid rgba(255,255,255,.03);
    border-bottom: 1px solid rgba(0,0,0,.18);
}

.sidebar-parent:hover {
    color: #fff;
    background: rgba(255,255,255,.04);
}

.sidebar-parent.expanded {
    color: #fff;
    background: rgba(255,255,255,.06);
}

.sidebar-link-icon {
    width: 42px;
    height: 46px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.03);
    border-right: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.76);
    font-size: .95rem;
}

.sidebar-parent.expanded .sidebar-link-icon {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar-link-label {
    flex: 1;
    min-width: 0;
    font-size: .93rem;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-link-arrow {
    color: rgba(255,255,255,.42);
    font-size: .72rem;
    transition: transform .18s ease, color .18s ease;
}

.sidebar-parent.expanded .sidebar-link-arrow,
.sidebar-parent:hover .sidebar-link-arrow {
    color: rgba(255,255,255,.75);
}

.sidebar-parent.expanded .sidebar-link-arrow {
    transform: rotate(90deg);
}

html.sidebar-state-pending .sidebar,
html.sidebar-state-pending .sidebar-parent,
html.sidebar-state-pending .sidebar-link-arrow,
html.sidebar-state-pending .sidebar-submenu {
    transition: none !important;
}

.sidebar-submenu {
    display: none;
    padding: .35rem 0 .45rem;
    border-bottom: 1px solid rgba(0,0,0,.16);
}

.sidebar-submenu.show {
    display: block;
}

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

.sidebar-submenu-item + .sidebar-submenu-item {
    margin-top: .1rem;
}

.sidebar-sublink {
    display: block;
    margin-left: 42px;
    padding: .45rem 1rem .45rem 1.1rem;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    font-size: .84rem;
    border-left: 1px solid rgba(255,255,255,.08);
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.sidebar-sublink:hover {
    color: #fff;
    background: rgba(255,255,255,.03);
    border-left-color: rgba(255,255,255,.22);
}

.sidebar-sublink.active {
    color: #fff;
    font-weight: 600;
    border-left-color: #39c7d0;
    background: rgba(57,199,208,.08);
}

.sidebar-clinical-group {
    margin: 1rem 1rem 0;
    padding: .7rem;
    border-radius: 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}

.sidebar-clinical-link {
    display: block;
    padding: .72rem .85rem;
    border-radius: 12px;
    color: rgba(255,255,255,.8);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.sidebar-clinical-link + .sidebar-clinical-link {
    margin-top: .3rem;
}

.sidebar-clinical-link:hover,
.sidebar-clinical-link.active {
    color: #fff;
    background: rgba(57,199,208,.12);
}

.sidebar-logout {
    padding: 0 1rem 1rem;
    flex: 0 0 auto;
    margin-top: 0;
    background: linear-gradient(180deg, rgba(29,33,41,0) 0%, rgba(29,33,41,.88) 22%, rgba(29,33,41,1) 100%);
}

.sidebar-logout-btn {
    min-height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.84);
    text-decoration: none;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}

.sidebar-logout-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1039;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0; /* Flex içerik taşmalarını (blowout) engelleyip scrollbar çıkarır */
    transition: margin-left .28s cubic-bezier(.4,0,.2,1);
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-title { font-weight: 700; font-size: 1.05rem; color: #1a202c; }

.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.topbar-metrics {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-right: .5rem;
}

.topbar-metric {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 32px;
    padding: .35rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: -.01em;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #f8fafc;
    color: #1f2937;
}

.topbar-metric i {
    font-size: .82rem;
}

.metric-emerald { background: #ecfdf5; color: #047857; }
.metric-slate { background: #f1f5f9; color: #475569; }
.metric-cyan { background: #ecfeff; color: #0f766e; }
.metric-amber { background: #fffbeb; color: #b45309; }
.metric-rose { background: #fff1f2; color: #be123c; }
.metric-violet { background: #f5f3ff; color: #6d28d9; }

.topbar-avatar {
    width: 34px; height: 34px;
    background: var(--quartz-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--quartz); font-size: 1rem;
}

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: 1.75rem 1.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}
.page-header .breadcrumb { font-size: .82rem; margin-bottom: .4rem; }
.breadcrumb-item a { color: var(--quartz); }

.fit-fly-page {
    padding-bottom: 2rem;
}

.fit-fly-shell {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fit-fly-page .page-header {
    margin-bottom: 0;
    padding-bottom: .25rem;
}

.fit-fly-page .page-header h1 {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: 1.55rem;
}

.page-header-subtitle {
    margin: .35rem 0 0;
    color: #667085;
    font-size: .93rem;
    line-height: 1.45;
    max-width: 60rem;
}

.fit-fly-card {
    border-color: #dde5ed;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .05);
    overflow: hidden;
}

.fit-fly-card .card-header {
    background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
    padding: .95rem 1.15rem;
}

.fit-fly-card .card-body {
    padding: 1.15rem 1.15rem 1.25rem;
}

.fit-fly-form .form-control,
.fit-fly-form .form-select {
    border-color: #d5dbe5;
    border-radius: 10px;
    min-height: 42px;
    box-shadow: none;
}

.fit-fly-form .form-control:focus,
.fit-fly-form .form-select:focus {
    border-color: var(--quartz);
    box-shadow: 0 0 0 .18rem rgba(0, 164, 172, .16);
}

.fit-fly-form textarea.form-control {
    min-height: 104px;
}

.fit-fly-label {
    margin-bottom: .35rem;
    color: #344054;
    font-size: .87rem;
    font-weight: 600;
}

.fit-fly-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .7rem .8rem;
    margin-top: .15rem;
}

.fit-fly-option-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}

.fit-fly-option {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 48px;
    padding: .65rem .8rem;
    margin: 0;
    border: 1px solid #dce3eb;
    border-radius: 12px;
    background: #f9fbfd;
    color: #344054;
    font-size: .9rem;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.fit-fly-option:hover {
    border-color: #bfdce0;
    background: #f2fbfc;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .04);
    transform: translateY(-1px);
}

.fit-fly-option .form-check-input {
    margin: 0;
    flex: 0 0 auto;
}

.fit-fly-table-wrap {
    overflow-x: auto;
}

.fit-fly-table {
    margin-bottom: 0;
    min-width: 1040px;
}

.fit-fly-table thead th {
    padding: .85rem .9rem;
    background: #f8fafc;
    color: #475467;
    border-bottom: 1px solid #e5e7eb;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.fit-fly-table tbody td {
    padding: .82rem .9rem;
    border-color: #eef2f7;
    vertical-align: top;
    font-size: .9rem;
}

.fit-fly-table tbody tr:nth-child(even) {
    background: #fbfdff;
}

.fit-fly-table tbody tr:hover {
    background: #f6fbfc;
}

/* ============================================================
   CARDS & STAT BOXES
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
    width: 52px; height: 52px; min-width: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.stat-icon.teal    { background: var(--quartz-light);  color: var(--quartz); }
.stat-icon.blue    { background: #e8f4fd;               color: #2196f3; }
.stat-icon.green   { background: #e8f8ef;               color: #28a745; }
.stat-icon.orange  { background: #fff3e0;               color: #ff9800; }

.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--text-muted-q); margin-top: .15rem; }

/* ---- General Card ---- */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* ============================================================
   TETKIK SONUÇLARI — TREE + TABLE
   ============================================================ */
.tetkik-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.tetkik-tree-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: calc(var(--topbar-h) + 1rem);
}

.tetkik-tree-card .card-header {
    background: var(--quartz);
    color: #fff;
    border-radius: 12px 12px 0 0;
    display: flex; align-items: center; gap: .5rem;
}

.tree-list { list-style: none; padding: .5rem; margin: 0; }
.tree-item { border-radius: 7px; }

.tree-category {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    cursor: pointer;
    border-radius: 7px;
    font-weight: 600;
    font-size: .87rem;
    color: #2d3748;
    transition: background .15s;
    user-select: none;
}
.tree-category:hover       { background: var(--quartz-xlight); }
.tree-category.open        { color: var(--quartz); }
.tree-category .arrow      { transition: transform .2s; font-size: .7rem; margin-left: auto; }
.tree-category.open .arrow { transform: rotate(90deg); }
.tree-category .badge-count {
    margin-left: auto;
    margin-right: .25rem;
    background: var(--quartz-light);
    color: var(--quartz);
    font-size: .7rem;
    border-radius: 999px;
    padding: .1rem .45rem;
}

.tree-tests { list-style: none; padding: .25rem 0 .25rem 1.5rem; margin: 0; }
.tree-test {
    padding: .35rem .75rem;
    border-radius: 6px;
    font-size: .83rem;
    cursor: pointer;
    color: #4a5568;
    transition: background .15s, color .15s;
}
.tree-test:hover  { background: var(--quartz-xlight); color: var(--quartz); }
.tree-test.active { background: var(--quartz); color: #fff; font-weight: 600; }

/* Tetkik Results Table */
.results-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-sm); }
.results-card .card-header { background: #fff; }

.result-status {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .25rem .7rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
}
.result-status.normal        { background: #e8f8ef; color: #28a745; }
.result-status.yuksek        { background: #fff3e0; color: #e65100; }
.result-status.dusuk         { background: #e8f4fd; color: #1565c0; }
.result-status.tamamlanmadi  { background: #f5f5f5; color: #757575; }

.result-status::before {
    content: ''; display: inline-block;
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor;
}

.table th {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #718096;
    border-bottom: 2px solid var(--border-color);
    padding: .65rem 1rem;
}
.table td {
    padding: .75rem 1rem;
    vertical-align: middle;
    font-size: .875rem;
    border-bottom: 1px solid #f1f3f5;
}
.table tbody tr:hover { background: var(--quartz-xlight); }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BELGELER SAYFASI
   ============================================================ */
.file-icon { font-size: 1.5rem; width: 40px; text-align: center; }
.file-icon.pdf  { color: #e53e3e; }
.file-icon.docx { color: #2b5ce6; }
.file-icon.xlsx { color: #38a169; }
.file-icon.jpg,
.file-icon.png  { color: #dd6b20; }
.file-icon.folder { color: #d69e2e; }
.file-icon.txt  { color: #718096; }

/* ============================================================
   DASHBOARD HUB
   ============================================================ */
.dashboard-hub {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dashboard-tabs {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .8rem 0;
    background: linear-gradient(180deg, #f8fbfc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border-color);
}

.dashboard-tab {
    border: none;
    background: transparent;
    color: #5f6c7b;
    font-weight: 700;
    font-size: .9rem;
    padding: .8rem 1rem;
    border-bottom: 3px solid transparent;
}

.dashboard-tab.active {
    color: var(--quartz);
    border-bottom-color: var(--quartz);
}

.dashboard-carousel {
    padding: 1rem 1rem 3rem;
}

.dashboard-carousel .carousel-indicators {
    bottom: .5rem;
    margin-bottom: 0;
}

.dashboard-carousel .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background-color: #c5d2d8;
    opacity: 1;
}

.dashboard-carousel .carousel-indicators .active {
    background-color: var(--quartz);
}

.dashboard-carousel .carousel-control-prev,
.dashboard-carousel .carousel-control-next {
    width: 52px;
}

.dashboard-carousel .carousel-control-prev-icon,
.dashboard-carousel .carousel-control-next-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(27, 43, 52, .72);
    background-size: 50% 50%;
}

.announcement-slide {
    min-height: 460px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
}

.announcement-slide::before,
.announcement-slide::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.announcement-slide::before {
    width: 280px;
    height: 280px;
    right: -90px;
    top: -120px;
    background: rgba(255,255,255,.2);
}

.announcement-slide::after {
    width: 240px;
    height: 240px;
    left: -110px;
    bottom: -120px;
    background: rgba(255,255,255,.14);
}

.theme-teal  { background: linear-gradient(135deg, #0f8f97 0%, #0a5c64 100%); color: #fff; }
.theme-amber { background: linear-gradient(135deg, #ef8d32 0%, #b95e0c 100%); color: #fff; }
.theme-blue  { background: linear-gradient(135deg, #2f73d9 0%, #183f87 100%); color: #fff; }
.theme-slate { background: linear-gradient(135deg, #3c4b59 0%, #1d2732 100%); color: #fff; }
.theme-rose  { background: linear-gradient(135deg, #c04c73 0%, #7c2947 100%); color: #fff; }

.announcement-copy,
.announcement-visual {
    position: relative;
    z-index: 1;
}

.announcement-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.announcement-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .8rem;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.announcement-copy h2 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.05;
    font-weight: 800;
    max-width: 12ch;
    margin-bottom: 1rem;
}

.announcement-copy p {
    max-width: 58ch;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255,255,255,.9);
    margin-bottom: 1.5rem;
}

.announcement-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.announcement-pill,
.announcement-date {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 .95rem;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: .85rem;
    font-weight: 600;
}

.announcement-visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
}

.visual-badge {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 16, 22, .2);
    border: 1px solid rgba(255,255,255,.18);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.visual-panel {
    padding: 1.4rem;
    border-radius: 20px;
    background: rgba(12, 18, 24, .22);
    border: 1px solid rgba(255,255,255,.16);
    backdrop-filter: blur(8px);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .7rem;
}

.visual-panel span {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .78rem;
    opacity: .8;
}

.visual-panel strong {
    font-size: 1.35rem;
    line-height: 1.45;
    font-weight: 700;
}

.dashboard-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.shortcut-card {
    min-height: 120px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.shortcut-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.shortcut-card i {
    font-size: 1.5rem;
}

.shortcut-card span {
    font-weight: 700;
    font-size: .92rem;
}

.shortcut-blue  { background: #eef5ff; color: #245fcb; border-color: #d5e5ff; }
.shortcut-amber { background: #fff5e9; color: #b86b13; border-color: #f0d7b2; }
.shortcut-green { background: #edf9f1; color: #1f8f4f; border-color: #cfead9; }
.shortcut-slate { background: #f2f5f8; color: #3e5468; border-color: #d5dde5; }

.stats-strip {
    display: grid;
    gap: 1rem;
    height: 100%;
}

.mini-stat {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 1.15rem 1.2rem;
}

.mini-stat-label {
    display: block;
    color: #718096;
    font-size: .82rem;
    margin-bottom: .45rem;
}

.mini-stat strong {
    display: block;
    font-size: 1.75rem;
    line-height: 1;
    color: #17212b;
}

/* ============================================================
   LEGACY ADMIN PANELS
   ============================================================ */
.legacy-panel {
    background: #fff;
    border: 1px solid #d5dbe1;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.legacy-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .65rem;
    background: linear-gradient(180deg, #fafcfe 0%, #f0f4f7 100%);
    border-bottom: 1px solid #d9e0e6;
}

.legacy-filter-row,
.legacy-filter-grid {
    display: grid;
    gap: .7rem .9rem;
    padding: .75rem .65rem;
    background: #f7f9fb;
    border-bottom: 1px solid #d9e0e6;
}

.legacy-filter-row {
    grid-template-columns: repeat(2, minmax(180px, 240px));
}

.legacy-filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.legacy-filter-item {
    min-width: 0;
}

.legacy-label {
    display: block;
    margin-bottom: .25rem;
    font-size: .78rem;
    font-weight: 700;
    color: #27313b;
}

.legacy-search-item {
    align-self: end;
}

.legacy-search-box {
    display: grid;
    grid-template-columns: 1fr 38px;
}

.legacy-search-box .form-control,
.legacy-search-box .btn {
    border-radius: 0;
}

.legacy-table {
    margin: 0;
}

.legacy-panel .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

.legacy-table th {
    background: #edf1f4;
    color: #202b36;
    font-size: .76rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    border-color: #d6dde4;
    padding: .45rem .5rem;
}

.legacy-table td {
    font-size: .79rem;
    padding: .42rem .5rem;
    border-color: #e0e6ec;
    white-space: nowrap;
}

.legacy-table tbody tr:nth-child(even) {
    background: #f9fbfc;
}

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

.legacy-table tbody tr.is-selected-indicator > td {
    background: rgba(0, 164, 172, .20) !important;
}

.legacy-table tbody tr.is-selected-indicator:hover > td {
    background: rgba(0, 164, 172, .24) !important;
}

.legacy-table tbody tr.is-passive-indicator > td:not(:last-child) {
    color: #dc2626;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.legacy-archive-table td:nth-child(5),
.legacy-archive-table td:nth-child(9) {
    min-width: 170px;
}

.legacy-panel .archive-table-scroll {
    max-height: calc(100vh - 310px);
    max-height: calc(100dvh - 310px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.archive-table-scroll .legacy-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: inset 0 -1px 0 #d6dde4;
}

.archive-footer-bar {
    flex-wrap: wrap;
}

.archive-footer-bar .archive-pagination {
    padding: 0;
    border-top: 0;
    background: transparent;
    justify-content: flex-end;
}

.archive-pagination-gap {
    display: inline-flex;
    align-items: center;
    padding: 0 .2rem;
    color: #718096;
}

@media (max-height: 760px) and (min-width: 768px) {
    .legacy-panel .archive-table-scroll {
        max-height: calc(100vh - 265px);
        max-height: calc(100dvh - 265px);
    }
}

.legacy-training-filter {
    grid-template-columns: repeat(2, minmax(180px, 220px));
}

.legacy-training-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.legacy-training-table th,
.legacy-training-table td {
    font-size: .74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.legacy-training-table th:nth-child(1),
.legacy-training-table td:nth-child(1) {
    width: 42px;
    text-align: center;
}

.analysis-filter-grid {
    grid-template-columns: 180px 180px minmax(260px, 1fr);
}

.analysis-filter-wide {
    min-width: 0;
}

.analysis-table td:last-child,
.analysis-table td:nth-last-child(2),
.analysis-table td:nth-last-child(3) {
    width: 52px;
    text-align: center;
}

.legacy-row-alert td {
    color: #dc2626;
    font-weight: 600;
}

.legacy-row-highlight {
    background: #fff3d1 !important;
}

.btn-analysis {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 4px;
    color: #fff;
    border: 0;
    background: #2483ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-analysis.btn-edit { background: #2483ff; }
.btn-analysis.btn-delete { background: #ef4444; }
.btn-analysis.btn-pdf { background: #0ea5b7; }

.analysis-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 26px;
    padding: 0 .45rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}

.dif-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem 1rem;
}

.dif-field {
    min-width: 0;
}

.dif-span-2 {
    grid-column: span 2;
}

.dif-span-4 {
    grid-column: 1 / -1;
}

.dif-field .form-label {
    margin-bottom: .35rem;
    font-size: .8rem;
    font-weight: 600;
    color: #334155;
}

.dif-field .input-group-text {
    min-width: 38px;
    justify-content: center;
}

#difModal .modal-dialog {
    max-width: 1180px;
    margin: 1rem auto;
}

#difModal .modal-content {
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

#difModal .modal-body {
    background: #fbfcfe;
    overflow-y: auto;
}

#difModal .modal-header,
#difModal .modal-footer {
    flex-shrink: 0;
}

#difModal .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #d9e0e6;
    z-index: 2;
}

#pukoModal .modal-dialog {
    max-width: 1180px;
    margin: 1rem auto;
}

#pukoModal .modal-content {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
}

#pukoModal .modal-body {
    background: #fbfcfe;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#pukoModal .modal-header,
#pukoModal .modal-footer {
    flex-shrink: 0;
}

#pukoModal .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #d9e0e6;
    z-index: 2;
}

#pukoParticipantModal .modal-content,
#pukoDocumentLinksModal .modal-content {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
}

#pukoParticipantModal .modal-body,
#pukoDocumentLinksModal .modal-body {
    overflow-y: auto;
}

.puko-team-card {
    grid-column: 1 / -1;
    border: 1px solid #d9e0e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.puko-team-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
    padding: .65rem;
    background: #f8fbff;
    border-left: 3px solid #20b7ff;
    border-bottom: 1px solid #dbe4ec;
}

.puko-team-toolbar .input-group-text:first-child {
    color: #dc2626;
    font-weight: 700;
}

.puko-team-table th,
.puko-team-table td {
    white-space: nowrap;
    font-size: .76rem;
}

.puko-team-table td:last-child {
    width: 90px;
    text-align: center;
}

#riskModal .modal-dialog {
    max-width: 1180px;
}

#riskModal .modal-body {
    background: #fbfcfe;
}

.risk-items-card {
    grid-column: 1 / -1;
    border: 1px solid #d9e0e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.risk-items-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .75rem;
    background: #f8fbff;
    border-left: 3px solid #20b7ff;
    border-bottom: 1px solid #dbe4ec;
}

.risk-items-table th,
.risk-items-table td {
    white-space: nowrap;
    font-size: .76rem;
}

.risk-items-table td:nth-last-child(1),
.risk-items-table td:nth-last-child(2) {
    width: 52px;
    text-align: center;
}

.js-risk-person-row {
    cursor: pointer;
}

.js-risk-person-row:hover {
    background: #eef6fb;
}

.fine-kinney-table-wrap {
    overflow-x: auto;
}

.fine-kinney-table td,
.fine-kinney-table th {
    font-size: .78rem;
}

.fk-blue { background: #0d6efd !important; color: #fff !important; }
.fk-green { background: #28a745 !important; color: #fff !important; }
.fk-amber { background: #ffc107 !important; color: #111 !important; }
.fk-navy { background: #0b1c87 !important; color: #fff !important; }
.fk-red { background: #c00000 !important; color: #fff !important; }
.fk-red-strong { background: #ff1e00 !important; color: #fff !important; }
.fk-yellow { background: #fff200 !important; color: #111 !important; }
.fk-cyan { background: #18b6f6 !important; color: #fff !important; }
.fk-green-strong { background: #08b54b !important; color: #fff !important; }

.legacy-training-table th:nth-child(2),
.legacy-training-table td:nth-child(2) {
    width: 78px;
}

.legacy-training-table th:nth-child(3),
.legacy-training-table td:nth-child(3) {
    width: 210px;
}

.legacy-training-table th:nth-child(4),
.legacy-training-table td:nth-child(4) {
    width: 170px;
}

.legacy-training-table th:nth-child(5),
.legacy-training-table td:nth-child(5) {
    width: 290px;
}

.legacy-training-table th:nth-child(6),
.legacy-training-table td:nth-child(6),
.legacy-training-table th:nth-child(8),
.legacy-training-table td:nth-child(8),
.legacy-training-table th:nth-child(9),
.legacy-training-table td:nth-child(9),
.legacy-training-table th:nth-child(11),
.legacy-training-table td:nth-child(11),
.legacy-training-table th:nth-child(12),
.legacy-training-table td:nth-child(12) {
    white-space: nowrap;
}

.legacy-training-table th:nth-child(7),
.legacy-training-table td:nth-child(7) {
    width: 250px;
}

.legacy-training-table th:nth-child(10),
.legacy-training-table td:nth-child(10) {
    width: 110px;
}

.legacy-training-table th:nth-child(12),
.legacy-training-table td:nth-child(12) {
    width: 122px;
}

.legacy-training-table th:nth-child(5),
.legacy-training-table td:nth-child(5),
.legacy-training-table th:nth-child(7),
.legacy-training-table td:nth-child(7),
.legacy-training-table th:nth-child(10),
.legacy-training-table td:nth-child(10) {
    white-space: nowrap;
}

.legacy-service-training-filter {
    grid-template-columns: 180px 180px minmax(260px, 420px);
}

.legacy-service-training-table {
    width: 100%;
    table-layout: fixed;
}

.legacy-service-training-table th,
.legacy-service-training-table td {
    font-size: .74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.legacy-service-training-table th:nth-child(1),
.legacy-service-training-table td:nth-child(1) {
    width: 42px;
    text-align: center;
}

.legacy-service-training-table th:nth-child(2),
.legacy-service-training-table td:nth-child(2) {
    width: 260px;
}

.legacy-service-training-table th:nth-child(3),
.legacy-service-training-table td:nth-child(3) {
    width: 330px;
}

.legacy-service-training-table th:nth-child(4),
.legacy-service-training-table td:nth-child(4),
.legacy-service-training-table th:nth-child(5),
.legacy-service-training-table td:nth-child(5) {
    width: 130px;
    white-space: nowrap;
}

.legacy-service-training-table th:nth-child(6),
.legacy-service-training-table td:nth-child(6) {
    width: 290px;
}

.legacy-service-training-table th:nth-child(7),
.legacy-service-training-table td:nth-child(7),
.legacy-service-training-table th:nth-child(8),
.legacy-service-training-table td:nth-child(8) {
    width: 120px;
    white-space: nowrap;
}

.legacy-footer-note {
    padding: .55rem .65rem;
    font-size: .76rem;
    color: #4a5561;
    border-top: 1px solid #d9e0e6;
    background: #fff;
}

.legacy-pagination {
    display: flex;
    justify-content: center;
    gap: .35rem;
    padding: .75rem;
    border-top: 1px solid #d9e0e6;
    background: #fbfcfd;
}

.legacy-pagination .btn {
    min-width: 34px;
    border-radius: 3px;
}

.legacy-pagination .btn.active {
    background: #3d84c6;
    border-color: #3d84c6;
    color: #fff;
}

.legacy-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .65rem;
    border-top: 1px solid #d9e0e6;
    background: #fff;
    font-size: .76rem;
    color: #4a5561;
}

/* ============================================================
   DOCUMENT MANAGER
   ============================================================ */
.doc-manager-page {
    padding-top: 1rem;
}

.doc-manager-panel {
    min-height: calc(100vh - 150px);
}

.doc-status-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .85rem;
    padding: 1rem;
    border-bottom: 1px solid #d9e0e6;
    background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 100%);
}

.doc-status-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 84px;
    padding: .9rem 1rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8edf4;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.doc-status-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.doc-status-label {
    display: block;
    margin-bottom: .2rem;
    font-size: .74rem;
    color: #64748b;
}

.doc-status-card strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1;
    color: #0f172a;
}

.doc-status-card.status-emerald .doc-status-icon { background: #ecfdf5; color: #047857; }
.doc-status-card.status-slate .doc-status-icon { background: #f1f5f9; color: #475569; }
.doc-status-card.status-cyan .doc-status-icon { background: #ecfeff; color: #0f766e; }
.doc-status-card.status-amber .doc-status-icon { background: #fffbeb; color: #b45309; }
.doc-status-card.status-rose .doc-status-icon { background: #fff1f2; color: #be123c; }
.doc-status-card.status-violet .doc-status-icon { background: #f5f3ff; color: #6d28d9; }

.doc-manager-topline {
    padding: .7rem .75rem;
    color: #2177e0;
    font-size: .95rem;
    font-weight: 700;
    border-bottom: 1px solid #d9e0e6;
    background: #fff;
}

.doc-manager-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    padding: .55rem .65rem;
    border-bottom: 1px solid #d9e0e6;
    background: #f8fafc;
}

.doc-manager-search {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 38px;
    width: min(620px, 100%);
}

.doc-manager-search .form-control,
.doc-manager-search .btn {
    border-radius: 0;
}

.doc-inline-switch {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    font-size: .82rem;
    color: #4b5968;
}

.doc-manager-layout {
    display: grid;
    grid-template-columns: clamp(240px, 18vw, 320px) minmax(0, 1fr);
    min-height: calc(100vh - 265px);
}

.doc-manager-layout.tree-collapsed {
    grid-template-columns: minmax(0, 1fr);
}

.doc-manager-layout.tree-collapsed .doc-tree-shell {
    display: none;
}

.doc-tree-shell {
    border-right: 1px solid #d9e0e6;
    background: #fff;
}

.doc-tree-scroll {
    height: 100%;
    max-height: calc(100vh - 266px);
    overflow: auto;
    padding: .35rem .35rem .6rem;
}

.doc-tree-level {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.doc-tree-level.depth-1,
.doc-tree-level.depth-2,
.doc-tree-level.depth-3,
.doc-tree-level.depth-4 {
    margin-left: 1rem;
    border-left: 1px dotted #b8c3ce;
}

.doc-node {
    position: relative;
}

.doc-tree-toggle,
.doc-tree-leaf {
    width: 100%;
    border: 0;
    background: transparent;
    color: #1869d8;
    font-size: .82rem;
    line-height: 1.35;
    display: flex;
    align-items: flex-start;
    gap: .25rem;
    text-align: left;
    padding: .16rem .3rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.doc-tree-toggle:hover,
.doc-tree-leaf:hover {
    color: #0b57c2;
    background: #e6f7f8;
}

.doc-tree-caret {
    width: 16px;
    flex: 0 0 16px;
    color: #687888;
    transition: transform .18s ease;
    margin-top: .05rem;
}

.doc-node.open > .doc-tree-toggle > .doc-tree-caret {
    transform: rotate(90deg);
}

.doc-tree-label {
    display: inline-block;
}

.doc-node-facility > .doc-tree-toggle .doc-tree-label {
    color: #f19a00;
    font-weight: 700;
}

.doc-node-section > .doc-tree-toggle .doc-tree-label {
    color: #e34c40;
    font-weight: 700;
}

.doc-node-branch > .doc-tree-toggle .doc-tree-label {
    color: #1772e4;
}

.doc-tree-children {
    margin-left: .45rem;
}

.doc-tree-leaf {
    padding-left: 1rem;
}

.doc-tree-leaf-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8aa5c7;
    margin-top: .45rem;
    flex: 0 0 5px;
}

.doc-tree-leaf:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px #23b7be;
    background: #e6f7f8;
}

.doc-tree-leaf.active {
    background: #ffd15c;
    box-shadow: inset 3px 0 0 #f59e0b;
}

.doc-tree-leaf.active .doc-tree-label {
    color: #553400;
    font-weight: 700;
}

.doc-tree-leaf.active .doc-tree-leaf-dot {
    background: #f59e0b;
}

.doc-grid-shell {
    background: #fff;
    display: flex;
    flex-direction: column;
}

.doc-grid-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 40px;
    padding: .3rem .75rem;
    border-bottom: 1px solid #d9e0e6;
    background: #fff;
}

.doc-cover-check {
    margin: 0;
    font-size: .8rem;
    color: #313c48;
}

/* Dokuman listesi 1000+ satira ciktiginda sayfa asiri uzuyordu;
   arsiv tablosundaki .archive-table-scroll kalibiyla ayni sekilde kendi icinde kaydirilir. */
.legacy-panel .doc-result-scroll {
    max-height: calc(100vh - 330px);
    max-height: calc(100dvh - 330px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.doc-result-scroll .legacy-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: inset 0 -1px 0 #d6dde4;
}

/* Tablo 12 sutunlu ve genis; Islem butonlarina ulasmak icin en saga kaydirmak
   gerekmesin diye son sutun saga yapisik kalir. */
.doc-result-scroll .doc-result-table th:last-child,
.doc-result-scroll .doc-result-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: #fff;
    box-shadow: inset 1px 0 0 #d6dde4;
}

.doc-result-scroll .doc-result-table thead th:last-child {
    z-index: 3;
    background: #edf1f4;
    box-shadow: inset 1px 0 0 #d6dde4, inset 0 -1px 0 #d6dde4;
}

.doc-result-scroll .doc-result-table tbody tr:nth-child(even) td:last-child {
    background: #f9fbfc;
}

.doc-result-scroll .doc-result-table tbody tr[data-doc-id]:hover td:last-child {
    background: #e8f7f8;
}

.doc-result-scroll .doc-result-table tbody tr[data-doc-id].is-selected td:last-child {
    background: #ffd15c;
}

/* Basliklar tek satira zorlanmasin: "Siradaki Gozden Gecirme" gibi uzun basliklar
   sutunu 155px'e geriyordu, iki satira kirilinca ~85px'e iniyor. */
.doc-result-table thead th {
    white-space: normal;
    vertical-align: bottom;
    line-height: 1.15;
}

/* Asil sorun: .legacy-table td { white-space: nowrap } yuzunden listedeki TEK bir
   uzun dokuman adi bile sutunu geriyordu (olculdu: 246px -> 881px, tablo 1368 -> 2003px).
   Sutun sinirlanir, tasan ad ... ile kisalir; tam ad hucrenin title'inda durur. */
.doc-result-table td:nth-child(3) {
    max-width: clamp(165px, 18vw, 320px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-result-table th:nth-child(1) { min-width: 100px; }
.doc-result-table th:nth-child(2) { min-width: 85px; }
.doc-result-table th:nth-child(3) { min-width: 165px; }
.doc-result-table th:nth-child(4),
.doc-result-table th:nth-child(6),
.doc-result-table th:nth-child(7),
.doc-result-table th:nth-child(8) { min-width: 82px; }
.doc-result-table th:nth-child(5),
.doc-result-table th:nth-child(9),
.doc-result-table th:nth-child(10),
.doc-result-table th:nth-child(11) { min-width: 52px; }
.doc-result-table th:nth-child(12) { min-width: 110px; }

.doc-result-table tbody tr[data-doc-id] {
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.doc-result-table tbody tr[data-doc-id]:hover {
    background: #e8f7f8 !important;
}

.doc-result-table tbody tr[data-doc-id]:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px #23b7be;
}

.doc-result-table tbody tr[data-doc-id].is-selected {
    background: #ffd15c !important;
}

.doc-result-table tbody tr[data-doc-id].is-selected > td {
    background: #ffd15c !important;
}

.doc-result-table tbody tr[data-doc-id].is-selected > td:first-child {
    box-shadow: inset 3px 0 0 #f59e0b;
}

.doc-result-table tbody tr[data-doc-id].is-selected:hover > td {
    background: #ffc84d !important;
}

.document-preview-frame-wrap {
    height: min(78vh, 820px);
    background: #f2f5f8;
}

.document-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
    position: relative;
    max-width: 380px;
}
.search-bar .form-control {
    padding-left: 2.5rem;
    border-radius: 8px;
    font-size: .875rem;
}
.search-bar .search-icon {
    position: absolute; left: .75rem; top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge-role { padding: .3rem .65rem; border-radius: 6px; font-size: .75rem; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert-quartz {
    background: var(--quartz-light);
    border: 1px solid #b2e4e7;
    color: var(--quartz-dark);
    border-radius: 10px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
    padding: .75rem 1.5rem;
    text-align: center;
    font-size: .78rem;
    color: #a0aec0;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

/* ============================================================
   RESPONSIVE — MOBİL
   ============================================================ */
@media (max-width: 991.98px) {
    :root {
        --sidebar-w: min(84vw, 320px);
    }
    body {
        overflow-x: hidden;
    }
    .sidebar {
        background: linear-gradient(180deg, var(--kp-navy) 0%, var(--kp-deep) 100%) !important;
        box-shadow: 16px 0 32px rgba(7, 30, 48, .32);
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }
    .tetkik-layout {
        grid-template-columns: 1fr;
    }
    .tetkik-tree-card {
        position: static;
    }
    .announcement-slide {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 1rem;
        padding: 1.2rem;
    }
    .announcement-slide::before,
    .announcement-slide::after {
        display: none;
    }
    .visual-panel {
        min-height: 180px;
    }
    .doc-manager-toolbar {
        align-items: stretch;
    }
    .doc-inline-switch {
        min-height: 38px;
    }
    .dashboard-shortcuts {
        grid-template-columns: 1fr;
    }
    .shortcut-card {
        min-height: 0;
        flex-direction: row;
        align-items: center;
        gap: .8rem;
        padding: .95rem 1rem;
    }
    .shortcut-card i {
        font-size: 1.35rem;
    }
    .shortcut-card span {
        font-size: .95rem;
    }
    .legacy-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .analysis-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dif-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #difModal .modal-dialog {
        margin: .5rem;
    }
    #difModal .modal-content {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    #pukoModal .modal-dialog,
    #pukoParticipantModal .modal-dialog,
    #pukoDocumentLinksModal .modal-dialog {
        margin: .5rem;
    }
    #pukoModal .modal-content,
    #pukoParticipantModal .modal-content,
    #pukoDocumentLinksModal .modal-content {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    .dif-span-2,
    .dif-span-4 {
        grid-column: auto;
    }
    .puko-team-toolbar {
        grid-template-columns: 1fr;
    }
    .risk-items-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .doc-manager-layout {
        grid-template-columns: 1fr;
    }
    .doc-status-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .doc-tree-shell {
        border-right: 0;
        border-bottom: 1px solid #d9e0e6;
    }
    .doc-tree-scroll {
        max-height: 420px;
    }
    .legacy-panel .doc-result-scroll {
        max-height: 460px;
    }
    .legacy-footer-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .sidebar-profile-role {
        display: none;
    }
    .sidebar-sections {
        padding-bottom: 1rem;
    }
    .sidebar-logout {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 575.98px) {
    .topbar {
        padding: 0 .85rem;
        gap: .6rem;
    }
    .topbar-title {
        flex: 1;
        min-width: 0;
        font-size: .98rem;
    }
    .topbar-actions {
        gap: .35rem;
        flex-shrink: 0;
    }
    .page-content  { padding: 1.25rem 1rem; }
    .page-header h1 {
        font-size: 1.1rem;
        line-height: 1.25;
    }
    .fit-fly-page .page-header h1 {
        font-size: 1.1rem;
    }
    .page-header-subtitle {
        font-size: .86rem;
    }
    .fit-fly-card .card-header,
    .fit-fly-card .card-body {
        padding-left: .95rem;
        padding-right: .95rem;
    }
    .fit-fly-option-grid,
    .fit-fly-option-grid--wide {
        grid-template-columns: 1fr;
    }
    .fit-fly-option {
        min-height: 44px;
        padding: .6rem .7rem;
        font-size: .88rem;
    }
    .fit-fly-table {
        min-width: 880px;
    }
    .stat-card     { padding: 1rem; }
    .stat-value    { font-size: 1.5rem; }
    .dashboard-tabs {
        display: flex;
        gap: .5rem;
        padding: .75rem .75rem 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .dashboard-tabs::-webkit-scrollbar { display: none; }
    .dashboard-tab {
        flex: 0 0 auto;
        min-width: 142px;
        padding: .72rem .8rem;
        font-size: .83rem;
        border: 1px solid #d7dde4;
        border-bottom-width: 1px;
        border-radius: 10px;
        white-space: nowrap;
    }
    .dashboard-tab.active {
        background: #fff;
    }
    .dashboard-carousel {
        padding: .65rem .65rem 2.75rem;
    }
    .announcement-slide {
        padding: 1rem;
        min-height: 0;
    }
    .announcement-eyebrow {
        margin-bottom: .75rem;
    }
    .announcement-copy h2 {
        max-width: none;
        font-size: 1.65rem;
        line-height: 1.1;
        margin-bottom: .8rem;
    }
    .announcement-copy p {
        font-size: .95rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    .announcement-meta {
        gap: .5rem;
    }
    .announcement-pill,
    .announcement-date {
        min-height: 34px;
        padding: 0 .75rem;
        font-size: .78rem;
    }
    .announcement-visual {
        display: none;
    }
    .dashboard-carousel .carousel-control-prev,
    .dashboard-carousel .carousel-control-next {
        display: none;
    }
    .dashboard-shortcuts {
        grid-template-columns: 1fr;
    }
    .stats-strip {
        grid-template-columns: 1fr;
    }
    .mini-stat strong {
        font-size: 1.35rem;
    }
    .card-header,
    .card-body {
        min-width: 0;
    }
    .legacy-filter-row,
    .legacy-filter-grid {
        grid-template-columns: 1fr;
    }
    .analysis-filter-grid {
        grid-template-columns: 1fr;
    }
    .dif-modal-grid {
        grid-template-columns: 1fr;
    }
    .doc-manager-search {
        width: 100%;
        grid-template-columns: 1fr 38px;
    }
    .doc-manager-topline {
        font-size: .84rem;
        overflow-x: auto;
        white-space: nowrap;
    }
    .doc-tree-scroll {
        max-height: 52vh;
    }
    .doc-status-strip {
        grid-template-columns: 1fr;
    }
    .sidebar-header {
        padding: .85rem .85rem .75rem;
    }
    .sidebar-profile {
        margin: .75rem .75rem 0;
        padding: .75rem .85rem;
    }
    .sidebar-quickbar {
        margin: .6rem .75rem 0;
        padding: .45rem;
        gap: .4rem;
    }
    .sidebar-quickbar-item {
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 10px;
        font-size: .95rem;
    }
    .sidebar-profile-avatar {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
    .sidebar-parent {
        min-height: 42px;
        padding-right: .7rem;
    }
    .sidebar-link-icon {
        width: 38px;
        height: 42px;
        flex-basis: 38px;
    }
    .sidebar-link-label {
        font-size: .88rem;
        line-height: 1.2;
    }
    .sidebar-sublink {
        margin-left: 38px;
        padding: .4rem .85rem .4rem .95rem;
        font-size: .8rem;
    }
    .sidebar-submenu {
        padding-bottom: .25rem;
    }
    .document-preview-frame-wrap {
        height: 72vh;
    }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner-quartz {
    width: 2rem; height: 2rem;
    border: 3px solid var(--quartz-light);
    border-top-color: var(--quartz);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #a0aec0; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--quartz); }

/* =============================================================
   KALİTEPUSULA THEME — application-wide product identity
   Tokens of kalitepusula.com (same as the login screen). Colour, border and typography overrides on the existing class
   names only: layout, responsive rules and DOM contracts stay as they are. The technical names --quartz* and
   .btn-quartz are kept and now resolve to the product palette. Semantic states (danger, warning, success) keep
   Bootstrap's colours.
   ============================================================= */
:root {
    --kp-navy:       #0B2D4A;
    --kp-deep:       #071E30;
    --kp-teal:       #14B8A6;
    --kp-teal-ink:   #087F78;
    --kp-teal-deep:  #066B65;
    --kp-mineral:    #3E6B87;
    --kp-mist:       #E7EEF2;
    --kp-sand:       #F8FAFB;
    --kp-line:       #D3DEE5;
    --kp-on-navy:    #B4C6D2;
    --kp-text:       #1E3347;
    --kp-text-muted: #5B6F80;

    --quartz:        var(--kp-teal-ink);
    --quartz-dark:   var(--kp-teal-deep);
    --quartz-light:  #DCF5F1;
    --quartz-xlight: #F0FAF8;
    --text-muted-q:  var(--kp-text-muted);
    --border-color:  var(--kp-line);
    --shadow-sm:     0 1px 2px rgba(11, 45, 74, .06);
    --shadow-md:     0 14px 30px -18px rgba(11, 45, 74, .32);
}

body { background: var(--kp-sand); color: var(--kp-text); }

/* Focus is always visible (keyboard) */
.app-layout a:focus-visible,
.app-layout button:focus-visible,
.app-layout .btn:focus-visible,
.modal a:focus-visible,
.modal button:focus-visible { outline: 2px solid var(--kp-teal-ink); outline-offset: 2px; }
.sidebar a:focus-visible,
.sidebar button:focus-visible { outline-color: var(--kp-teal); }

/* ---- Sidebar ---- */
.sidebar { background: linear-gradient(180deg, var(--kp-navy) 0%, var(--kp-deep) 100%); }
.sidebar-header { border-bottom-color: rgba(180, 198, 210, .14); }
.kp-sidebar-brand { color: #fff; gap: .65rem; }
.kp-sidebar-brand:hover { color: #fff; }
.kp-sidebar-mark { width: 38px; height: auto; flex: none; color: #fff; }
.kp-sidebar-wordmark { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; color: #fff; white-space: nowrap; }
.kp-sidebar-org {
    margin: .85rem 1rem 0;
    padding: .55rem .75rem;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kp-sidebar-org-logo { max-width: 100%; max-height: 40px; width: auto; height: auto; object-fit: contain; }
.sidebar-profile { border-radius: 14px; background: rgba(255, 255, 255, .05); border-color: rgba(180, 198, 210, .14); }
.sidebar-profile-avatar { background: linear-gradient(135deg, var(--kp-teal) 0%, var(--kp-teal-ink) 100%); }
.sidebar-profile-role { color: var(--kp-on-navy); }
.sidebar-quickbar { border-radius: 14px; background: rgba(255, 255, 255, .04); border-color: rgba(180, 198, 210, .14); }
.sidebar-quickbar-item { border-radius: 10px; border-color: rgba(180, 198, 210, .2); color: #E6EEF3; }
.sidebar-quickbar-item:hover { border-color: rgba(20, 184, 166, .55); background: rgba(20, 184, 166, .14); }
.sidebar-quickbar-item.active { border-color: var(--kp-teal); background: rgba(20, 184, 166, .22); }
.sidebar-parent { color: #E6EEF3; border-bottom-color: rgba(0, 0, 0, .14); }
.sidebar-parent:hover, .sidebar-parent.expanded { background: rgba(255, 255, 255, .05); }
.sidebar-link-icon { color: var(--kp-on-navy); background: transparent; border-right-color: rgba(180, 198, 210, .12); }
.sidebar-parent.expanded .sidebar-link-icon { color: var(--kp-teal); background: rgba(20, 184, 166, .08); }
.sidebar-link-arrow { color: rgba(180, 198, 210, .55); }
.sidebar-submenu { border-bottom-color: rgba(0, 0, 0, .14); }
.sidebar-sublink { color: var(--kp-on-navy); border-left-color: rgba(180, 198, 210, .16); }
.sidebar-sublink:hover { color: #fff; background: rgba(255, 255, 255, .04); border-left-color: rgba(20, 184, 166, .5); }
.sidebar-sublink.active { color: #fff; border-left-color: var(--kp-teal); background: rgba(20, 184, 166, .14); box-shadow: inset 2px 0 0 var(--kp-teal); }
.sidebar-logout { background: linear-gradient(180deg, rgba(7, 30, 48, 0) 0%, rgba(7, 30, 48, .9) 22%, var(--kp-deep) 100%); }
.sidebar-logout-btn { border-radius: 12px; color: #E6EEF3; border-color: rgba(180, 198, 210, .16); }
.sidebar-overlay { background: rgba(7, 30, 48, .55); }

/* ---- Topbar and page header ---- */
.topbar { border-bottom-color: var(--kp-line); box-shadow: none; }
.topbar-title { color: var(--kp-navy); letter-spacing: -.01em; }
.topbar .btn-light { background: #fff; border: 1px solid var(--kp-line); color: var(--kp-navy); }
.topbar .btn-light:hover, .topbar .btn-light:focus { background: var(--kp-mist); border-color: var(--kp-line); color: var(--kp-navy); }
.topbar-avatar { background: var(--quartz-light); color: var(--kp-teal-ink); }
.page-header h1 { color: var(--kp-navy); letter-spacing: -.01em; }
.breadcrumb-item a { color: var(--kp-teal-ink); }
.breadcrumb-item.active { color: var(--kp-text-muted); }
.app-footer { color: var(--kp-text-muted); }

/* ---- Buttons ---- */
.btn-quartz { background: var(--kp-navy); border-color: var(--kp-navy); }
.btn-quartz:hover, .btn-quartz:focus { background: var(--kp-mineral); border-color: var(--kp-mineral); }
.btn-quartz:disabled { background: #9FB3C2; border-color: #9FB3C2; }
.btn-primary {
    --bs-btn-bg: var(--kp-navy);
    --bs-btn-border-color: var(--kp-navy);
    --bs-btn-hover-bg: var(--kp-mineral);
    --bs-btn-hover-border-color: var(--kp-mineral);
    --bs-btn-active-bg: var(--kp-deep);
    --bs-btn-active-border-color: var(--kp-deep);
    --bs-btn-disabled-bg: #9FB3C2;
    --bs-btn-disabled-border-color: #9FB3C2;
    --bs-btn-focus-shadow-rgb: 8, 127, 120;
}
.btn-outline-primary {
    --bs-btn-color: var(--kp-navy);
    --bs-btn-border-color: var(--kp-navy);
    --bs-btn-hover-bg: var(--kp-navy);
    --bs-btn-hover-border-color: var(--kp-navy);
    --bs-btn-active-bg: var(--kp-deep);
    --bs-btn-active-border-color: var(--kp-deep);
    --bs-btn-focus-shadow-rgb: 8, 127, 120;
}
.btn-outline-secondary {
    --bs-btn-color: var(--kp-mineral);
    --bs-btn-border-color: var(--kp-line);
    --bs-btn-hover-bg: var(--kp-mist);
    --bs-btn-hover-color: var(--kp-navy);
    --bs-btn-hover-border-color: var(--kp-line);
}

/* ---- Forms ---- */
.form-control, .form-select { border-color: var(--kp-line); color: var(--kp-text); }
.form-control:focus, .form-select:focus { border-color: var(--kp-teal-ink); box-shadow: 0 0 0 .2rem rgba(8, 127, 120, .18); }
.form-check-input:checked { background-color: var(--kp-teal-ink); border-color: var(--kp-teal-ink); }
.form-check-input:focus { border-color: var(--kp-teal-ink); box-shadow: 0 0 0 .2rem rgba(8, 127, 120, .18); }
.form-label { color: var(--kp-navy); }

/* ---- Cards, stat cards, tables, modals ---- */
.card, .stat-card, .dashboard-hub { border-color: var(--kp-line); }
.card-header { border-bottom-color: var(--kp-line); color: var(--kp-navy); }
.stat-value { color: var(--kp-navy); }
.table > thead th, .table thead th { color: var(--kp-navy); border-bottom-color: var(--kp-line); }
.table-light, .table > thead.table-light th { --bs-table-bg: #EEF3F6; --bs-table-color: var(--kp-navy); }
.modal-content { border-color: var(--kp-line); border-radius: 14px; }
.modal-header { border-bottom-color: var(--kp-line); }
.modal-title { color: var(--kp-navy); font-weight: 700; }
.modal-footer { border-top-color: var(--kp-line); }
.dropdown-menu { border-color: var(--kp-line); }
.dropdown-item:active { background: var(--kp-teal-ink); }
.nav-tabs .nav-link.active { color: var(--kp-navy); border-bottom-color: var(--kp-teal-ink); }
.page-link { color: var(--kp-teal-ink); }
.active > .page-link, .page-link.active { background: var(--kp-navy); border-color: var(--kp-navy); }

/* ---- Dashboard ---- */
.dashboard-tabs { background: linear-gradient(180deg, var(--kp-sand) 0%, #fff 100%); border-bottom-color: var(--kp-line); }
.dashboard-tab { color: var(--kp-text-muted); }
.dashboard-tab.active { color: var(--kp-navy); border-bottom-color: var(--kp-teal); }
.dashboard-carousel .carousel-indicators [data-bs-target] { background-color: var(--kp-line); }
.dashboard-carousel .carousel-indicators .active { background-color: var(--kp-teal-ink); }
.theme-teal { background: linear-gradient(135deg, var(--kp-navy) 0%, var(--kp-teal-deep) 100%); }
.theme-slate { background: linear-gradient(135deg, var(--kp-mineral) 0%, var(--kp-deep) 100%); }
.shortcut-card { border-color: var(--kp-line); }
.shortcut-card:hover { border-color: var(--kp-teal); }
.mini-stat { border-color: var(--kp-line); }
.mini-stat-label { color: var(--kp-text-muted); }

@media (prefers-reduced-motion: reduce) {
    .sidebar, .main-content, .shortcut-card, .stat-card, .sidebar-parent, .sidebar-sublink, .sidebar-link-arrow { transition: none !important; }
}

/* ---- Shared module UI (BRAND phase 1C): toolbars, filters, legacy tables ----
   Scoped to the shared legacy containers. A green .btn-success inside a page toolbar is that page's create action
   ("Yeni ...", "Manuel Ekle") and follows the primary style; .btn-success elsewhere (status toggles, modal actions)
   keeps its semantic colour. Table rules keep nowrap and the horizontal scroll container unchanged. */
.legacy-panel { border-color: var(--kp-line); border-radius: 12px; }
.legacy-toolbar { gap: .6rem; padding: .75rem 1rem; background: #fff; border-bottom-color: var(--kp-line); }
.legacy-toolbar .btn-success,
.doc-manager-toolbar .btn-success {
    --bs-btn-bg: var(--kp-navy);
    --bs-btn-border-color: var(--kp-navy);
    --bs-btn-hover-bg: var(--kp-mineral);
    --bs-btn-hover-border-color: var(--kp-mineral);
    --bs-btn-active-bg: var(--kp-deep);
    --bs-btn-active-border-color: var(--kp-deep);
    --bs-btn-disabled-bg: #9FB3C2;
    --bs-btn-disabled-border-color: #9FB3C2;
    --bs-btn-focus-shadow-rgb: 8, 127, 120;
}
.legacy-toolbar .btn-outline-info,
.doc-manager-toolbar .btn-outline-info {
    --bs-btn-color: var(--kp-teal-ink);
    --bs-btn-border-color: var(--kp-teal-ink);
    --bs-btn-hover-bg: var(--kp-teal-ink);
    --bs-btn-hover-border-color: var(--kp-teal-ink);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--kp-teal-deep);
    --bs-btn-active-border-color: var(--kp-teal-deep);
}
.legacy-filter-row, .legacy-filter-grid { gap: .8rem 1rem; padding: .9rem 1rem; background: var(--kp-sand); border-bottom-color: var(--kp-line); }
.legacy-label { font-size: .8rem; font-weight: 600; color: var(--kp-navy); }
.legacy-table th { background: #EEF3F6; color: var(--kp-navy); font-size: .78rem; font-weight: 600; padding: .5rem .5rem; border-color: var(--kp-line); }
.legacy-table td { font-size: .82rem; padding: .45rem .5rem; border-color: #E3EAEF; }
.legacy-table tbody tr:nth-child(even) { background: #FAFCFD; }
.legacy-table tbody tr:hover { background: rgba(20, 184, 166, .06); }
.legacy-table tbody tr.is-selected-indicator > td { background: rgba(20, 184, 166, .18) !important; }
.legacy-table tbody tr.is-selected-indicator:hover > td { background: rgba(20, 184, 166, .24) !important; }
.legacy-footer-note { color: var(--kp-text-muted); font-size: .82rem; }
