/* ============================================================
   CMZ TEKNİK — Panel Tema Dosyası
   Renk paleti logodan türetilmiştir (lacivert + mavi + gümüş)
   ============================================================ */

:root {
    --cmz-koyu: #0A1128;
    --cmz-koyu2: #0D1B3E;
    --cmz-mavi: #2979FF;
    --cmz-mavi-acik: #4FC3F7;
    --cmz-gumus: #C9D1D9;
    --cmz-beyaz: #F5F7FA;
    --cmz-basari: #2e7d32;
    --cmz-uyari: #f9a825;
    --cmz-tehlike: #d32f2f;
    --sidebar-width: 250px;
    --topbar-height: 60px;
    --bottomnav-height: 62px;
}

[data-bs-theme="dark"] {
    --bs-body-bg: var(--cmz-koyu);
    --bs-body-color: var(--cmz-gumus);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f4f6f9;
}
[data-bs-theme="dark"] body {
    background: var(--cmz-koyu);
}

/* ------------------ TOPBAR ------------------ */
.cmz-topbar {
    height: var(--topbar-height);
    background: linear-gradient(90deg, var(--cmz-koyu), var(--cmz-koyu2));
    color: var(--cmz-beyaz);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.logo-text {
    font-weight: 800;
    letter-spacing: .5px;
    font-size: 1.35rem;
    background: linear-gradient(90deg, var(--cmz-beyaz), var(--cmz-mavi-acik), var(--cmz-beyaz));
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: cmzLogoSheen 4s linear infinite;
}
@keyframes cmzLogoSheen {
    0%   { background-position: 0% center; }
    100% { background-position: -250% center; }
}
@media (prefers-reduced-motion: reduce) {
    .logo-text { animation: none; }
}
.cmz-topbar img.logo-icon {
    height: 34px;
    width: 34px;
    object-fit: contain;
    border-radius: 8px;
}
.cmz-topbar-kamera-rozeti {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(41,121,255,.16);
    border: 1px solid rgba(79,195,247,.28);
    color: var(--cmz-mavi-acik);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ------------------ SIDEBAR (masaüstü) ------------------ */
.cmz-sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width); /* içerik ne kadar taşarsa taşsın daralmasın */
    background: var(--cmz-koyu);
    color: var(--cmz-gumus);
    min-height: 100vh;
    position: sticky;
    top: 0;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* Uydu/güvenlik temalı dekoratif ızgara deseni */
.cmz-sidebar::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
/* Yumuşak radar parıltısı */
.cmz-sidebar::after {
    content: '';
    position: absolute;
    top: -120px; left: 50%;
    transform: translateX(-50%);
    width: 340px; height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(41,121,255,.16), transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: sidebarNabiz 5s ease-in-out infinite;
}
@keyframes sidebarNabiz {
    0%, 100% { opacity: .6; }
    50% { opacity: 1; }
}
.cmz-sidebar > * { position: relative; z-index: 1; }
.cmz-sidebar nav.nav { flex: 1 1 auto; overflow-y: auto; }
.cmz-sidebar-durum {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    font-size: .68rem;
    color: rgba(255,255,255,.4);
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.cmz-sidebar-durum .durum-noktasi { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.cmz-sidebar-durum .rec-nokta {
    width: 6px; height: 6px; border-radius: 50%; background: #ff5252; box-shadow: 0 0 6px #ff5252;
    animation: recYanip 1.4s ease-in-out infinite;
}
@keyframes recYanip { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
main.flex-grow-1 {
    min-width: 0;     /* flex öğelerinin içerik yüzünden taşıp kardeşleri sıkıştırmasını engeller */
    overflow-x: auto;
}
.cmz-sidebar .nav-link {
    color: var(--cmz-gumus);
    padding: 10px 18px;
    border-radius: 8px;
    margin: 2px 10px;
    display: flex;
    align-items: center;
    font-size: .93rem;
}
/* İkon + yazı etiketi: tekli linkler VE alt menülü başlıklar aynı bu class'ı kullanır,
   böylece ikisi de birebir aynı hizada durur. */
.cmz-sidebar .cmz-menu-label,
.cmz-offcanvas .cmz-menu-label {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cmz-sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.cmz-sidebar .nav-link:hover,
.cmz-sidebar .nav-link.active {
    background: rgba(41, 121, 255, 0.18);
    color: var(--cmz-mavi-acik);
}

/* Alt menü (collapse) */
.cmz-sidebar .cmz-submenu-chevron,
.cmz-offcanvas .cmz-submenu-chevron {
    transition: transform .2s ease;
}
.cmz-sidebar a[aria-expanded="true"] .cmz-submenu-chevron,
.cmz-offcanvas a[aria-expanded="true"] .cmz-submenu-chevron {
    transform: rotate(180deg);
}
.cmz-sidebar .cmz-submenu-link,
.cmz-offcanvas .cmz-submenu-link {
    padding-left: 30px;
    font-size: .86rem;
    opacity: .85;
}
.cmz-sidebar .cmz-submenu-link i,
.cmz-offcanvas .cmz-submenu-link i {
    font-size: .95rem;
}
.cmz-sidebar .cmz-submenu-link:hover,
.cmz-offcanvas .cmz-submenu-link:hover,
.cmz-sidebar .cmz-submenu-link.active,
.cmz-offcanvas .cmz-submenu-link.active {
    opacity: 1;
    background: rgba(41, 121, 255, 0.12);
    color: var(--cmz-mavi-acik);
}

/* ------------------ MOBİL YANDAN AÇILAN MENÜ (offcanvas) ------------------ */
.cmz-offcanvas {
    background: var(--cmz-koyu);
    width: 260px;
}
.cmz-offcanvas .nav-link {
    color: var(--cmz-gumus);
    padding: 12px 20px;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.cmz-offcanvas .nav-link i { font-size: 1.15rem; width: 22px; text-align: center; }
.cmz-offcanvas .nav-link:hover,
.cmz-offcanvas .nav-link.active {
    background: rgba(41, 121, 255, 0.18);
    color: var(--cmz-mavi-acik);
}

/* Mobil hızlı ekleme butonu (sağ altta sabit) */
.cmz-fab {
    position: fixed;
    right: 18px;
    bottom: 22px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--cmz-mavi);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 18px rgba(41,121,255,.5);
    z-index: 1035;
    text-decoration: none;
    padding-bottom: env(safe-area-inset-bottom);
}
.cmz-fab:hover { background: #1e5fd9; color: #fff; }

.cmz-content {
    padding: 18px 16px 90px 16px;
}
@media (min-width: 992px) {
    .cmz-content { padding: 24px 28px; }
}
@media (max-width: 991.98px) {
    .cmz-sidebar { display: none; }
}

/* ------------------ KARTLAR / WIDGET ------------------ */
.cmz-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
    padding: 18px;
}
[data-bs-theme="dark"] .cmz-card {
    background: var(--cmz-koyu2);
    border-color: rgba(255,255,255,.06);
}
.cmz-card .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--cmz-koyu); }
[data-bs-theme="dark"] .cmz-card .stat-value { color: var(--cmz-beyaz); }
.cmz-card .stat-label { color: #7a8699; font-size: .82rem; }
.cmz-icon-badge {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(41,121,255,.12);
    color: var(--cmz-mavi);
    font-size: 1.2rem;
}

/* ------------------ RENKLİ (VIVID) İSTATİSTİK KARTLARI ------------------ */
.stat-vivid {
    position: relative;
    overflow: hidden;
    border: none;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.stat-vivid .stat-label { color: rgba(255,255,255,.85); font-weight: 500; }
.stat-vivid .stat-value { color: #fff; }
.stat-vivid .cmz-icon-badge { background: rgba(255,255,255,.2); color: #fff; }
.stat-vivid::after {
    content: '';
    position: absolute;
    right: -22px; top: -26px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
}
.stat-vivid::before {
    content: '';
    position: absolute;
    right: 18px; bottom: -34px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.stat-blue   { background: linear-gradient(135deg, #2979FF, #1a56cc); }
.stat-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.stat-teal   { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.stat-red    { background: linear-gradient(135deg, #f87171, #dc2626); }
.stat-green  { background: linear-gradient(135deg, #4ade80, #16a34a); }

/* ------------------ HATIRLATMA KARTI (dikkat çekici, temadan bağımsız) ------------------ */
.cmz-card-hatirlatma {
    background: linear-gradient(135deg, #fb923c, #d9770a 65%, #b45309);
    border: none;
    box-shadow: 0 6px 20px rgba(217,119,6,.35);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.cmz-card-hatirlatma::after {
    content: '';
    position: absolute;
    right: -30px; top: -34px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.cmz-card-hatirlatma h6 { color: #fff; }
.cmz-card-hatirlatma h6 i { color: #fff !important; }
.cmz-card-hatirlatma .hatirlatma-satiri { border-bottom-color: rgba(255,255,255,.28) !important; position: relative; z-index: 1; }
.cmz-card-hatirlatma .fw-semibold { color: #fff; }
.cmz-card-hatirlatma .text-muted { color: rgba(255,255,255,.88) !important; }
.cmz-card-hatirlatma .hatirlatma-satiri > a > i {
    color: #fff !important;
    background: rgba(255,255,255,.22);
    border-radius: 6px;
    padding: 3px;
}
.cmz-card-hatirlatma .hatirlatma-kapat { color: rgba(255,255,255,.85) !important; }
.cmz-card-hatirlatma .hatirlatma-kapat:hover { color: #fff !important; }
.cmz-card-hatirlatma #hatirlatmaBos { color: rgba(255,255,255,.85) !important; }

/* ------------------ BUTONLAR ------------------ */
.btn-cmz {
    background: var(--cmz-mavi);
    border-color: var(--cmz-mavi);
    color: #fff;
    font-weight: 600;
}
.btn-cmz:hover { background: #1e5fd9; border-color: #1e5fd9; color:#fff; }
.btn-outline-cmz {
    border-color: var(--cmz-mavi);
    color: var(--cmz-mavi);
    font-weight: 600;
}
.btn-outline-cmz:hover { background: var(--cmz-mavi); color:#fff; }

/* Dokunma alanlarını mobilde büyütmek için */
@media (max-width: 767.98px) {
    .btn, .form-control, .form-select { min-height: 44px; }
    .form-control, .form-select { font-size: 1rem; }
}

/* Login sayfası */
.cmz-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at top left, #12245c, var(--cmz-koyu) 60%);
}

/* Topbar hızlı arama */
#hizliAramaInput::placeholder { color: rgba(255,255,255,.55); }
#hizliAramaInput:focus { background: rgba(255,255,255,.16) !important; box-shadow: none; color: #fff; }
#hizliAramaSonuclar .list-group-item { font-size: .85rem; }
