*:focus, *:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Arama eşleşme vurgusu (MarkupString içinde kullanıldığı için global) */
.highlight {
    background-color: rgba(252, 193, 44, 0.45);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
    font-weight: 600;
}


/* ============================================= */
/* Variables.css - MERKEZİ TEMA YÖNETİMİ       */
/* ============================================= */
:root {
    /* === Ana Tema Renkleri === */
    --color-primary: #FF5931;
    --color-primary-dark: #E0431E;
    --color-primary-gradient: #F3B859;
    --color-primary-hover: #F28369;
    --color-text: var(--color-text-primary);
    --color-secondary: #FCC12C;
    --color-secondary-hover: #FDD05E;
    /* === Nötr Renkler (Light - Varsayılan) === */
    --color-bg-page: #F9FAFB;
    --color-bg-panel: #FFFFFF;
    --color-bg-input: #F3F4F6;
    --color-text-primary: #1F2937;
    --color-text-secondary: #6B7280;
    --color-text-placeholder: #9CA3AF;
    --color-text-light: #FFFFFF;
    --color-border-subtle: #E5E7EB;
    --color-border-focus: var(--color-primary);
    --color-overlay: rgba(0, 0, 0, 0.5);
    --color-shadow: rgba(0, 0, 0, 0.05);
    --color-shadow-hover: rgba(0, 0, 0, 0.1);
    /* === Durum Renkleri === */
    --color-product-price: #8d6502;
    --color-success: #B8860B;
    --color-success-bg: #f0ece9;
    --color-danger: #F64C4C;
    --color-danger-bg: #fef2f2;
    --color-danger-border: #fecaca;
    --color-warning: #FFAD0D;
    --color-warning-bg: #fefce8;
    --color-info: #0F766E;          /* teal - turuncunun tamamlayicisi (eskiden mavi #2563eb) */
    --color-info-bg: #E6F4F2;
    /* === Sidebar (Light) === */
    --color-switch: var(--color-primary); /* Turuncu (açık durumda) */
    --color-switch-bg: #ccc; /* Gri (kapalı durumda) */
    --sidebar-bg: #423E37;
    --sidebar-text-color: rgba(255, 255, 255, 0.75);
    --sidebar-text-hover-color: #FFFFFF;
    --sidebar-active-bg: #504C45;
    --sidebar-active-text-color: #FFFFFF;
    --sidebar-active-border-color: var(--color-primary);
    /* === Component === */
    --color-selection-bg: #fffbeb;
    --color-selection-border: #d4a26d;
    --color-selection-text: #5d4037;
    /* === MASA RENKLERİ (Light Mode) === */
    /* Boş Masa */
    --table-empty-bg: var(--color-bg-panel);
    --table-empty-border: var(--color-border-subtle);
    --table-empty-text: var(--color-text-secondary);
    --table-empty-opacity: 0.8;
    --table-empty-hover-bg: var(--color-bg-input);
    --table-empty-hover-border: var(--color-text-primary);
    --table-empty-hover-opacity: 1;
    /* Dolu Masa */
    --table-occupied-bg: var(--color-selection-bg);
    --table-occupied-border: var(--color-selection-border);
    --table-occupied-text: var(--color-selection-text);
    /* Rezerve Masa */
    --table-reserved-bg: var(--color-warning-bg);
    --table-reserved-border: var(--color-warning);
    --table-reserved-text: var(--color-warning);
    /* Hesap Yazılmış Masa */
    --table-bill-ready-bg: var(--color-danger-bg);
    --table-bill-ready-border: var(--color-danger);
    --table-bill-ready-text: var(--color-danger);
    --table-bill-ready-shadow: rgba(246, 76, 76, 0.4);
    /* Dashboard Specific */
    --dashboard-bg: var(--color-bg-page);
    --dashboard-card-bg: var(--color-bg-panel);
    --dashboard-text-primary: var(--color-text-primary);
    --dashboard-text-secondary: var(--color-text-secondary);
    --dashboard-border: var(--color-border-subtle);
    --dashboard-hover-bg: var(--color-bg-input);
    --dashboard-hover-color: var(--color-primary);
}

/* ============================================= */
/* KARANLIK TEMA (html.dark olduğunda)           */
/* ============================================= */
html.dark {
    /* === Nötr Renkler (SICAK DARK MODE) === */
    --color-switch: var(--color-primary);
    --color-switch-bg: #4a5568; /* Dark modda daha koyu gri */
    --color-bg-page: #262420;
    --color-bg-panel: #423E37;
    --color-bg-input: #544F46;
    /* === Yazılar === */
    --color-text-primary: #EAEAEA;
    --color-text-secondary: #B0A89E;
    --color-text-placeholder: #857F75;
    --color-text-light: #EAEAEA;
    --color-border-subtle: #5C564D;
    --color-overlay: rgba(0, 0, 0, 0.75);
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-shadow-hover: rgba(0, 0, 0, 0.5);
    /* === Durum Renkleri (Dark) === */
    --color-success: #84cc16;
    --color-success-bg: rgba(132, 204, 22, 0.15);
    --color-danger: #f87171;
    --color-danger-bg: #5c2b2b;
    --color-danger-border: #7f1d1d;
    --color-warning: #fbbf24;
    --color-warning-bg: #4d3e20;
    --color-info: #2DD4BF;          /* koyu temada teal (eskiden mavi #60a5fa) */
    --color-info-bg: rgba(45, 212, 191, 0.15);
    /* === Component === */
    --color-selection-bg: rgba(255, 89, 49, 0.15);
    --color-selection-border: var(--color-primary);
    --color-selection-text: #FF5931;
    /* === MASA RENKLERİ (Dark Mode) === */
    /* Boş Masa */
    --table-empty-bg: var(--color-bg-panel);
    --table-empty-border: var(--color-border-subtle);
    --table-empty-text: var(--color-text-secondary);
    --table-empty-opacity: 0.8;
    --table-empty-hover-bg: var(--color-bg-input);
    --table-empty-hover-border: #EAEAEA;
    --table-empty-hover-opacity: 1;
    /* Dolu Masa */
    --table-occupied-bg: #4a3b2a;
    --table-occupied-border: var(--color-primary);
    --table-occupied-text: #FF5931;
    /* Rezerve Masa */
    --table-reserved-bg: #4d3e20;
    --table-reserved-border: #fbbf24;
    --table-reserved-text: #fbbf24;
    /* Hesap Yazılmış Masa */
    --table-bill-ready-bg: #5c2b2b;
    --table-bill-ready-border: #f87171;
    --table-bill-ready-text: #ff9999;
    --table-bill-ready-shadow: rgba(248, 113, 113, 0.4);
    /* Dashboard Specific (Dark Override) */
    --dashboard-bg: var(--color-bg-page);
    --dashboard-card-bg: var(--color-bg-panel);
    --dashboard-text-primary: var(--color-text-primary);
    --dashboard-text-secondary: var(--color-text-secondary);
    --dashboard-border: var(--color-border-subtle);
    --dashboard-hover-bg: var(--color-bg-input);
}
/* html de boyanır: GoPOS iframe'i içinde .page-body sabit yükseklikte olduğundan
   içeriğin üstünde/altında kalan canvas alanı beyaz kalmasın (gömülü mod). */
html, body {
    background-color: var(--color-bg-page);
    color: var(--color-text-primary);
}

/* Gömülü (GoPOS iframe) modunda sayfalar standalone topbar'a göre hesaplanmış
   sabit yükseklik (height: calc(100vh - 100px)) kullanıyor; bu, embedded nav
   daha kısa olduğu için altta boşluk bırakıyor. Gömülüyken gövde kabı doldursun. */
html[data-gopos="embedded"] .page-body {
    height: 100%;
}

/* Gömülü modda sayfa başlığı yazıları gizlenir (üst nav zaten hangi sayfada
   olduğunu gösteriyor → daha düzenli). Standalone GoStock'ta başlıklar durur.
   Ürünler'in sekme başlığı (.tabs-nav) ve Dashboard'ın "Yenile" butonu korunur. */
html[data-gopos="embedded"] .panel-title-row {
    display: none;
}
/* :has destekleyen tarayıcıda, YALNIZCA başlıktan ibaret olan başlık barı (padding/çizgi) kaldırılır.
   Araç satırı (arama, filtre, "Yeni ..." düğmeleri: .header-tools) olan başlıklar görünür kalır; yalnızca başlık yazısı gizlenir.
   (Eskiden bar tümden gizleniyor, Hammaddeler/Depolar gibi sayfalarda ekleme düğmeleri kayboluyordu.) */
html[data-gopos="embedded"] .panel-header:has(.panel-title-row):not(:has(.header-tools)) {
    display: none;
}
/* Dashboard (Stok Raporu) başlık + alt yazı gizlenir; Yenile butonu kalır. */
html[data-gopos="embedded"] .report-title,
html[data-gopos="embedded"] .report-sub {
    display: none;
}

/* =================================================================== */
/* KOYU TEMA — Bootstrap varsayılan sınıfları (henüz tamamlanmamış     */
/* sayfalar tema değişkenleri yerine .card/.text-muted vb. kullanıyor) */
/* =================================================================== */
html.dark .card {
    background-color: var(--color-bg-panel);
    border-color: var(--color-border-subtle);
    color: var(--color-text-primary);
}

html.dark .card-header,
html.dark .card-footer {
    background-color: var(--color-bg-panel) !important;
    border-color: var(--color-border-subtle) !important;
    color: var(--color-text-primary);
}

html.dark .text-dark {
    color: var(--color-text-primary) !important;
}

html.dark .text-muted,
html.dark .text-secondary {
    color: var(--color-text-secondary) !important;
}

html.dark .bg-white {
    background-color: var(--color-bg-panel) !important;
}

html.dark .bg-light {
    background-color: var(--color-bg-input) !important;
}

html.dark .table {
    color: var(--color-text-primary);
    --bs-table-bg: transparent;
    --bs-table-color: var(--color-text-primary);
}

html.dark .table-light,
html.dark .table-light > th,
html.dark .table-light > td {
    background-color: var(--color-bg-input) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border-subtle) !important;
}

html.dark .modal-content {
    background-color: var(--color-bg-panel);
    color: var(--color-text-primary);
    border-color: var(--color-border-subtle);
}

html.dark .form-control,
html.dark .form-select {
    background-color: var(--color-bg-page);
    color: var(--color-text-primary);
    border-color: var(--color-border-subtle);
}

    html.dark .form-control::placeholder {
        color: var(--color-text-placeholder);
    }

html.dark hr {
    border-color: var(--color-border-subtle);
}

/* ========== MASAÜSTÜ GENEL YERLEŞİM (FLEXBOX) ========== */
.app-layout {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

/* ========== ÜST BAR (TOPBAR) TASARIMI ========== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 24px;
    background-color: var(--color-bg-panel);
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none; /* Masaüstünde hamburger menü butonunu gizle */
}

/* ========== İKON BUTONLARI ========== */
.icon-btn {
    background: transparent;
    border: none !important; /* Standart HTML buton çizgisini sil */
    color: var(--color-text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .icon-btn:hover {
        background-color: var(--color-bg-input);
        color: var(--color-text-primary);
    }

.text-success {
    color: #10b981 !important;
}

/* Bildirim Rozeti */
.notif-btn {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Kullanıcı Alanı */
.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--color-primary-bg-subtle, #FFEDE8);   /* eskiden indigo #e0e7ff */
    color: var(--color-primary-dark, #E0431E);                   /* eskiden indigo #4f46e5 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-body {
    flex: 1;
    padding: 2px;
    background-color: var(--color-bg-page);
    overflow-y: auto;
}

/* ========== TOPBAR TEK SATIR GARANTİSİ + KULLANICI MENÜSÜ ========== */
.topbar {
    flex-wrap: nowrap;
    gap: 12px;
}

.topbar-left {
    flex-shrink: 0;
}

.topbar-left-extra {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-right {
    flex-shrink: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu-container {
    position: relative;
    flex-shrink: 0;
}

.user-chip {
    background: none;
    border: none;
    font: inherit;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    color: var(--color-text-primary);
}

    .user-chip:hover {
        background-color: var(--color-bg-input);
    }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background-color: var(--color-bg-panel);
    border: 1px solid var(--color-border-subtle);
    border-radius: 10px;
    box-shadow: 0 8px 24px var(--color-shadow-hover);
    padding: 6px;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

    .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .user-dropdown .dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        text-align: left;
        padding: 0.65rem 0.75rem;
        background: none;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        color: var(--color-text-primary);
        font-size: 0.9rem;
        transition: background-color 0.2s ease;
    }

        .user-dropdown .dropdown-item:hover {
            background-color: var(--color-bg-input);
        }

        .user-dropdown .dropdown-item i {
            width: 16px;
            text-align: center;
            color: var(--color-text-secondary);
        }

/* ========================================================= */
/* ========== MOBİL GÖRÜNÜM (768px ve altı) ================ */
/* ========================================================= */
@media (max-width: 768px) {
    /* Masaüstü menüsünü sayfadan kopar, sola gizle */
    .sidebar-container {
        position: fixed;
        top: 0;
        left: -100%; /* Sola sakla */
        width: 260px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease-in-out;
    }

    /* isSidebarCollapsed false olduğunda (menü açıldığında) içeri kaydır */
    .app-layout:not(.collapsed) .sidebar-container {
        left: 0;
    }

    /* İlk çizimde (genişlik ölçülene kadar) menü açık görünüp içeriği kapatmasın */
    .app-layout.disable-transitions .sidebar-container {
        left: -100%;
    }
    .app-layout.disable-transitions .sidebar-overlay {
        display: none !important;
    }

    /* Arka plan karartması */
    .app-layout:not(.collapsed) .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .app-layout.collapsed .sidebar-overlay, .sidebar-overlay {
        display: none;
    }

    /* Üst barda Hamburger Butonunu Göster, Kullanıcı Adını Gizle */
    .mobile-menu-btn {
        display: flex;
    }

    .user-info, .chevron-down {
        display: none;
    }

    .topbar {
        padding: 0 12px;
    }
}

/* Yetkisi olmayan kullanıcıdan gizlenen öğeler (GoStock işlem rolleri) */
.perm-hidden { display: none !important; }

/* Bildirim açılır paneli (üst çubuk) */
.notif-container { position: relative; display: inline-flex; }

.notif-dropdown { min-width: 300px; max-width: 360px; }

.notif-title {
    padding: 0.4rem 0.75rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.notif-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.notif-item span, .notif-enable span { display: flex; flex-direction: column; line-height: 1.25; }
.notif-item small, .notif-enable small { font-size: 0.75rem; color: var(--color-text-secondary); font-weight: 400; }

@media (max-width: 768px) {
    .notif-dropdown { position: fixed; top: 56px; left: 8px; right: 8px; max-width: none; }
}

/* Yazma işlemi sürerken ekran kilidi: tıklamalar engellenir, kısa işlemlerde göstergeyi gizli tutan gecikme */
.busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: progress;
    animation: busyOverlayIn .2s ease .25s both;
}

.busy-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1.4rem;
    border-radius: 12px;
    background: var(--color-bg-panel);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-subtle);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
    font-size: 0.95rem;
    font-weight: 500;
}

.busy-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--color-border-subtle);
    border-top-color: var(--color-primary, #4f46e5);
    border-radius: 50%;
    animation: busySpin .7s linear infinite;
}

@keyframes busySpin { to { transform: rotate(360deg); } }
@keyframes busyOverlayIn { from { background: rgba(0,0,0,0); opacity: 0; } to { background: rgba(0,0,0,.28); opacity: 1; } }

/* Üst çubuk marka ikonu: yalnızca dar ekranda (masaüstünde kenar çubuğunda logo var) */
.topbar-mark {
    display: none;
    height: 30px;
    width: 30px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .topbar-mark { display: block; }
}

/* ========== MOBİL ÜST ÇUBUK (768px ve altı): tek satır, taşma yok ========== */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }

    .topbar {
        height: 56px;
        padding: 0 8px;
        gap: 6px;
    }

    .topbar-left { gap: 6px; }

    /* Şube seçici kalan alanı doldurur, uzun adlar "…" ile kısalır */
    .topbar-left-extra {
        flex: 1 1 0;
        min-width: 0;
        margin-left: 0;
    }

    .branch-dd { width: 100%; }
    .branch-dd .gs-dd-btn { width: 100%; min-width: 0; padding: 0.35rem 0.55rem; font-size: 0.82rem; }
    /* Telefonda liste ekran genişliğine sabitlenir (düğmenin solundaki boşluk yüzünden sağa taşmasın) */
    .branch-dd .gs-dd-menu { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; min-width: 0; max-width: none; }

    .topbar-right { gap: 2px; }
    .header-controls { gap: 2px; }

    .topbar .icon-btn {
        width: 38px;
        height: 38px;
    }

    .user-chip { padding: 0.2rem; }
    .user-avatar { width: 32px; height: 32px; }

    /* Kullanıcı menüsü ekrandan taşmasın */
    .user-dropdown { right: 0; max-width: calc(100vw - 16px); }

    /* Sayfa gövdesi: kenar boşluklarını daralt, yatay taşmayı kes */
    .content-body { overflow-x: hidden; }
}

/* ========================================================= */
/* ========== MODERN AÇILIR LİSTELER ======================= */
/* ========================================================= */

/* Tüm yerel <select> kutuları: yuvarlak, okları özel, odakta vurgu */
select:not([multiple]):not([size]) {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--color-bg-panel);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    color: var(--color-text);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.6rem;
    padding-right: 2.1rem;
    cursor: pointer;
    text-overflow: ellipsis;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

select:not([multiple]):not([size]):hover:not(:disabled) {
    border-color: var(--color-primary);
}

select:not([multiple]):not([size]):focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 89, 49, 0.18);
}

select:not([multiple]):not([size]):disabled {
    opacity: .55;
    cursor: not-allowed;
}

select option {
    background: var(--color-bg-panel);
    color: var(--color-text);
}

html.dark select:not([multiple]):not([size]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B0A89E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Üst çubuktaki şube seçici (özel açılır liste) */
.gs-dd {
    position: relative;
    display: inline-block;
    min-width: 0;
}

.gs-dd-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 190px;
    padding: 0.4rem 0.7rem;
    background: var(--color-bg-panel);
    color: var(--color-text);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.65rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.gs-dd-btn:hover,
.gs-dd.open .gs-dd-btn {
    border-color: var(--color-primary);
}

.gs-dd.open .gs-dd-btn {
    box-shadow: 0 0 0 3px rgba(255, 89, 49, 0.18);
}

.gs-dd-ico {
    color: var(--color-primary);
    font-size: 0.85rem;
}

.gs-dd-label {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gs-dd-chev {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    transition: transform .2s ease;
}

.gs-dd.open .gs-dd-chev {
    transform: rotate(180deg);
}

.gs-dd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
}

.gs-dd-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1100;
    min-width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.3rem;
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    animation: gs-dd-in .14s ease-out;
}

@keyframes gs-dd-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.gs-dd-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    background: transparent;
    color: var(--color-text);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.gs-dd-item > span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gs-dd-item > i:first-child {
    color: var(--color-text-secondary);
    width: 1rem;
    text-align: center;
}

.gs-dd-item:hover {
    background: var(--color-bg-input);
}

.gs-dd-item.active {
    background: rgba(255, 89, 49, 0.12);
    color: var(--color-primary);
    font-weight: 600;
}

.gs-dd-item.active > i:first-child,
.gs-dd-check {
    color: var(--color-primary);
}

/* gövdeye eklenen, <select> için açılan liste */
.gs-dd-float {
    position: fixed;
    z-index: 3000;
}

select.gs-open {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 89, 49, 0.18);
}

/* ========================================================= */
/* ========== NASIL ÇALIŞIR? / KULLANIM KILAVUZU =========== */
/* ========================================================= */
.help-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid var(--color-border-subtle);
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.help-btn:hover { color: var(--color-primary); border-color: var(--color-primary); background: rgba(255, 89, 49, 0.06); }
.help-btn i { font-size: 1rem; }

.help-btn { flex-shrink: 0; }
.topbar-left-extra { min-width: 0; }
.topbar-left-extra .gs-dd-btn { min-width: 0; }

@media (max-width: 1100px) {
    .topbar .help-btn { width: 38px; padding: 0; justify-content: center; }
    .topbar .help-btn-label { display: none; }
}

@media (max-width: 768px) {
    .topbar .help-btn { width: 38px; height: 38px; padding: 0; justify-content: center; border-color: transparent; }
    .topbar .help-btn-label { display: none; }
}

.help-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.help-modal {
    width: 100%;
    max-width: 680px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    background: var(--color-bg-panel);
    color: var(--color-text);
    border-radius: 0.9rem;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: gs-dd-in .16s ease-out;
}

.help-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--color-border-subtle);
}

.help-head h3, .guide-section h3 { margin: 0; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 0.55rem; }
.help-head h3 i, .guide-section h3 i { color: var(--color-primary); }

.help-close {
    width: 34px; height: 34px;
    border: 0; border-radius: 0.5rem;
    background: var(--color-bg-input);
    color: var(--color-text-secondary);
    cursor: pointer;
}
.help-close:hover { color: var(--color-text); }

.help-body { padding: 1rem 1.1rem; overflow-y: auto; }

.help-summary { margin: 0 0 0.9rem; color: var(--color-text-secondary); font-size: 0.92rem; line-height: 1.5; }

.help-steps { list-style: none; counter-reset: help-step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }

.help-steps li {
    counter-increment: help-step;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.85rem 0.7rem 2.9rem;
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.7rem;
    background: var(--color-bg-page, transparent);
}

.help-steps li::before {
    content: counter(help-step);
    position: absolute;
    left: 0.8rem; top: 0.75rem;
    width: 1.5rem; height: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.help-steps li strong { font-size: 0.92rem; }
.help-steps li span { font-size: 0.87rem; line-height: 1.5; color: var(--color-text-secondary); }

.help-tips {
    margin-top: 0.9rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.7rem;
    background: rgba(255, 89, 49, 0.08);
    border: 1px solid rgba(255, 89, 49, 0.25);
}
.help-tips-title { font-weight: 700; font-size: 0.85rem; color: var(--color-primary); margin-bottom: 0.35rem; }
.help-tips ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.86rem; line-height: 1.5; }

.help-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--color-border-subtle);
}
.help-link { color: var(--color-primary); font-weight: 600; font-size: 0.86rem; text-decoration: none; display: inline-flex; gap: 0.4rem; align-items: center; }
.help-link:hover { text-decoration: underline; }
.help-ok {
    height: 36px; padding: 0 1.1rem; border: 0; border-radius: 0.55rem;
    background: var(--color-primary); color: #fff; font-weight: 600; cursor: pointer;
}

/* Kullanım Kılavuzu sayfası */
.guide-panel { display: flex; flex-direction: column; min-height: 0; }
.guide-header { padding: 0.55rem 0.9rem; }
.guide-header .panel-title { margin: 0; font-size: 1.05rem; }

.guide-layout { flex: 1; min-height: 0; display: flex; gap: 1.25rem; padding: 0.75rem; overflow: hidden; }

.guide-toc {
    flex: 0 0 240px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 0.15rem;
    padding-right: 0.5rem;
}
.guide-toc-title { font-size: 0.72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-secondary); margin: 0.2rem 0 0.4rem 0.6rem; }
.guide-toc a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.45rem 0.6rem; border-radius: 0.5rem;
    color: var(--color-text); text-decoration: none; font-size: 0.87rem;
}
.guide-toc a i { width: 1.1rem; text-align: center; color: var(--color-text-secondary); }
.guide-toc a:hover { background: var(--color-bg-input); }

.guide-content { flex: 1; min-width: 0; overflow-y: auto; padding-right: 0.5rem; scroll-behavior: smooth; }
.guide-intro { color: var(--color-text-secondary); font-size: 0.92rem; line-height: 1.55; margin: 0 0 1rem; }
.guide-section { padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--color-border-subtle); scroll-margin-top: 0.5rem; }
.guide-section:last-child { border-bottom: 0; }
.guide-section h3 { margin-bottom: 0.4rem; }

@media (max-width: 768px) {
    .help-overlay { padding: 0; align-items: flex-end; }
    .help-modal { max-width: none; max-height: 92vh; border-radius: 1rem 1rem 0 0; }
    .guide-layout { flex-direction: column; gap: 0.5rem; overflow-y: auto; }
    .guide-toc { flex: none; flex-direction: row; overflow-x: auto; overflow-y: visible; padding: 0 0 0.4rem; }
    .guide-toc-title { display: none; }
    .guide-toc a { white-space: nowrap; border: 1px solid var(--color-border-subtle); border-radius: 999px; }
    .guide-toc a i { display: none; }
    .guide-content { overflow: visible; padding: 0; }
}

.help-body, .guide-content { overflow-x: hidden; }
.help-steps li, .help-steps li strong, .help-steps li span, .help-summary, .help-tips li, .guide-intro {
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
}


/* ========================================================= */
/* ========== AÇIK/KOYU UYUMLU DURUM RENKLERİ ============== */
/* ========================================================= */
:root {
    --tone-ok-fg: #15803d;
    --tone-danger-fg: #b91c1c;
    --tone-admin-fg: #4338ca;
    --tone-info-fg: #0369a1;
    --tone-warn-fg: #b45309;
}

html.dark {
    --tone-ok-fg: #86efac;
    --tone-danger-fg: #fca5a5;
    --tone-admin-fg: #a5b4fc;
    --tone-info-fg: #7dd3fc;
    --tone-warn-fg: #fcd34d;
}

/* Bootstrap (CDN) sonradan yüklenip body rengini koyu yazıya çeviriyordu; rengi tek yerden zorla */
html body { color: var(--color-text-primary); }
html.dark input, html.dark textarea, html.dark select { color: var(--color-text-primary); }
html.dark ::placeholder { color: var(--color-text-placeholder); }

html.dark { color-scheme: dark; }
html:not(.dark) { color-scheme: light; }

/* Bootstrap "subtle" rozetleri koyu temada açık kalıyordu: tema renklerine bağla */
html.dark .bg-success-subtle { background-color: rgba(34, 197, 94, 0.16) !important; }
html.dark .text-success { color: var(--tone-ok-fg) !important; }
html.dark .border-success-subtle { border-color: rgba(34, 197, 94, 0.4) !important; }
html.dark .bg-secondary-subtle { background-color: rgba(255, 255, 255, 0.08) !important; }
html.dark .text-secondary { color: var(--color-text-secondary) !important; }
html.dark .border-secondary-subtle { border-color: var(--color-border-subtle) !important; }
html.dark .bg-warning-subtle { background-color: rgba(251, 191, 36, 0.16) !important; }
html.dark .text-warning { color: var(--tone-warn-fg) !important; }
html.dark .bg-danger-subtle { background-color: rgba(248, 113, 113, 0.16) !important; }
html.dark .text-danger { color: var(--tone-danger-fg) !important; }
html.dark .border-danger-subtle { border-color: rgba(248, 113, 113, 0.4) !important; }
html.dark .bg-info-subtle { background-color: rgba(45, 212, 191, 0.16) !important; }
html.dark .text-primary { color: #ff8566 !important; }

/* Henüz yapılmamış (yer tutucu) sayfalar */
.stub-page { padding: 1rem; }
.stub-page h4 { color: var(--color-text-primary); }

/* Rapor sayfaları arası sekmeler */
.rt-tabs { display: flex; gap: 0.25rem; padding: 0 0.75rem; border-bottom: 1px solid var(--color-border-subtle); flex-shrink: 0; overflow-x: auto; }
.rt-tab {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 0.9rem; color: var(--color-text-secondary); text-decoration: none; white-space: nowrap;
    border-bottom: 3px solid transparent; font-weight: 500; font-size: 0.92rem;
}
.rt-tab:hover { color: var(--color-text-primary); }
.rt-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }


/* Tek sayfada rapor sekmeleri (Raporlar merkez sayfası) */
.rp-hub { height: calc(100vh - 100px); display: flex; flex-direction: column; min-height: 0; padding: 0.5rem 0.5rem 0; }
.rp-hub > .rt-tabs {
    background: var(--color-bg-panel);
    border: 0; border-bottom: 1px solid var(--color-border-subtle);
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .05);
}
.rp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
/* İçteki sayfalar kendi sabit yüksekliğini/kenar boşluğunu bırakır; sekme çubuğunun altında birleşik panel olur */
.rp-body .page-body { height: 100% !important; flex: 1; min-height: 0; }
.rp-body .content-panel { margin: 0 !important; border-radius: 0 0 0.5rem 0.5rem !important; }
.rp-body .report-wrap { max-width: none; }
html[data-gopos="embedded"] .rp-hub { height: 100%; padding: 0; }
@media (max-width: 768px) {
    .rp-hub { height: calc(100vh - 76px); padding: 0.25rem 0.25rem 0; }
}
