/* =============================================================
   Quartz Döküman Yönetim Sistemi — 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
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.auth-form-side {
    flex: 0 0 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: #fff;
    z-index: 2;
}

.auth-hero-side {
    flex: 1;
    background: linear-gradient(135deg, var(--quartz) 0%, var(--quartz-dark) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3rem;
    color: #fff;
}

.auth-logo svg { height: 48px; width: auto; }

.auth-hero-side h1 { font-size: 2rem; font-weight: 700; }
.auth-hero-side p  { opacity: .85; font-size: 1.05rem; }

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: .75rem 1rem;
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    margin-bottom: .75rem;
}
.auth-feature .icon-box {
    width: 38px; height: 38px; min-width: 38px;
    background: rgba(255,255,255,.2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.auth-feature h6 { margin: 0; font-weight: 600; font-size: .9rem; }
.auth-feature p  { margin: 0; font-size: .8rem; opacity: .8; }

.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);
    min-height: 100vh;
    background:
        radial-gradient(circle at bottom left, rgba(255, 178, 55, .08), transparent 34%),
        linear-gradient(180deg, #262a33 0%, #1d2129 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;
}

.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;
}

.sidebar-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #11b5bf 0%, #0d7e86 100%);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 10px 24px rgba(17,181,191,.28);
}

.sidebar-brand-text {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.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-sections {
    padding: .9rem 0 1rem;
}

.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);
}

.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-logout {
    padding: 0 1rem 1rem;
    margin-top: auto;
}

.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;
    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-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); }

/* ============================================================
   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-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-archive-table td:nth-child(5),
.legacy-archive-table td:nth-child(9) {
    min-width: 170px;
}

.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-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: 460px minmax(0, 1fr);
    min-height: calc(100vh - 265px);
}

.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: .08rem 0;
    text-decoration: none;
}

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

.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.active .doc-tree-label {
    color: #0d58c0;
    font-weight: 700;
}

.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;
}

.doc-result-table th:nth-child(1) { min-width: 140px; }
.doc-result-table th:nth-child(2) { min-width: 200px; }
.doc-result-table th:nth-child(3),
.doc-result-table th:nth-child(4),
.doc-result-table th:nth-child(5),
.doc-result-table th:nth-child(8),
.doc-result-table th:nth-child(9),
.doc-result-table th:nth-child(10) { min-width: 70px; }
.doc-result-table th:nth-child(6),
.doc-result-table th:nth-child(7) { min-width: 155px; }

/* ============================================================
   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) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .tetkik-layout {
        grid-template-columns: 1fr;
    }
    .tetkik-tree-card {
        position: static;
    }
    .announcement-slide {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .visual-panel {
        min-height: 180px;
    }
    .dashboard-shortcuts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .legacy-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .doc-manager-layout {
        grid-template-columns: 1fr;
    }
    .doc-tree-shell {
        border-right: 0;
        border-bottom: 1px solid #d9e0e6;
    }
    .doc-tree-scroll {
        max-height: 420px;
    }
    .legacy-footer-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .auth-hero-side {
        display: none;
    }
    .auth-form-side {
        max-width: 100%;
        padding: 2rem 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .page-content  { padding: 1.25rem 1rem; }
    .stat-card     { padding: 1rem; }
    .stat-value    { font-size: 1.5rem; }
    .dashboard-tabs {
        gap: 0;
        padding: .45rem .55rem 0;
    }
    .dashboard-tab {
        flex: 1;
        padding: .75rem .5rem;
        font-size: .82rem;
    }
    .dashboard-carousel {
        padding: .75rem .75rem 3rem;
    }
    .announcement-slide {
        padding: 1.2rem;
    }
    .announcement-copy h2 {
        max-width: none;
        font-size: 1.6rem;
    }
    .dashboard-shortcuts {
        grid-template-columns: 1fr;
    }
    .legacy-filter-row,
    .legacy-filter-grid {
        grid-template-columns: 1fr;
    }
    .doc-manager-search {
        width: 100%;
        grid-template-columns: 1fr 38px;
    }
}

/* ============================================================
   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: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--quartz); }
