.app-header {
    height: 70px;
    flex-shrink: 0;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 10px rgba(0,0,0,0.01);
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--canvas-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 16px;
}
.header-btn:hover {
    background-color: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--success-light);
}
.header-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger, #ef4444);
    border: 2px solid var(--card-bg);
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: var(--canvas-bg);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
}
.header-profile:hover {
    border-color: var(--brand-primary);
    background-color: var(--success-light);
}
.header-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.header-profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.header-profile-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.header-profile-role {
    font-size: 11px;
    color: var(--brand-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    overflow: hidden;
}
.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, padding-left 0.2s;
}
.dropdown-item:hover {
    background-color: var(--success-light);
    color: var(--brand-primary);
    padding-left: 24px;
}
.dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.dropdown-item.text-danger {
    color: var(--danger);
}
.dropdown-item.text-danger:hover {
    background-color: var(--danger-light);
    color: var(--danger);
}
.dropdown-divider {
    height: 1px;
    background-color: var(--border);
    margin: 8px 0;
    border: none;
}

/* --- Mobile Specific Overrides (max-width: 576px) --- */
@media (max-width: 576px) {
    .app-header {
        padding: 0 12px !important;
    }
    .header-left {
        gap: 10px !important;
    }
    .header-btn span {
        display: none !important; /* Hide text in buttons on mobile */
    }
    .header-profile {
        padding: 4px;
    }
    .header-profile-info {
        display: none !important; /* Hide name/role on mobile */
    }
    .notification-dropdown {
        position: fixed !important;
        top: calc(60px + env(safe-area-inset-top, 0px)) !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100dvh - 76px) !important;
        display: flex;
        flex-direction: column;
    }
    .notification-list,
    .notif-list {
        max-height: calc(100dvh - 170px) !important;
    }
    .profile-dropdown {
        right: 0;
        max-width: calc(100vw - 20px);
    }
    .gpdb-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .gpdb-btn-complete,
    .gpdb-btn-cards {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }
}

/* --- Notification Dropdown --- */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}
.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.notification-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notification-list {
    max-height: 300px;
    overflow-y: auto;
}
.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    transition: background 0.2s;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item:hover {
    background-color: var(--input-bg);
}
.notification-item.unread {
    background-color: var(--success-light);
}
.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    flex-shrink: 0;
}
.notification-content {
    flex: 1;
}
.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 4px 0;
}
.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}
.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}
.notification-dropdown-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--border);
}
.notification-dropdown-footer a {
    color: var(--brand-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.notification-dropdown-footer a:hover {
    text-decoration: underline;
}

.header-default-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background-color: var(--border, #E6E9EB);
    color: var(--text-muted, #4B5563);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-sizing: border-box;
}


/* =========================================================
   PWA NATIVE HEADER (APP BAR)
   ========================================================= */
@media (max-width: 991px) {
    .app-header {
        height: 60px !important; /* Biraz daha dar App Bar */
        padding: 0 16px !important;
        padding-top: env(safe-area-inset-top) !important; 
        position: sticky !important;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    }
    
    /* Masaüstü Breadcrumb, Logo vs. fazlalıkları gizle veya küçült */
    .header-breadcrumb {
        display: none !important;
    }
    .header-search {
        display: none !important; /* Mobilde arama butonu ikona dönüşmeli veya gizlenmeli */
    }
    
    /* Başlık için sayfa ortasına App Title hissi */
    .header-left {
        flex: 1 !important;
        justify-content: flex-start !important;
    }
    .header-right {
        gap: 8px !important;
    }
}
@keyframes highlightNotif {
    0% { background-color: rgba(16, 185, 129, 0.2); }
    100% { background-color: transparent; }
}

/* =========================================================
   GLOBAL GECİKMİŞ ÖDEME (PAST DUE) UYARI BANDI
   Header ile Main Layout Arası, Saatlik Tekrarlı Kurumsal Şerit
   ========================================================= */
.global-past-due-banner {
    width: 100%;
    background: linear-gradient(90deg, #991b1b 0%, #b91c1c 50%, #991b1b 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    padding: 10px 32px;
    z-index: 38;
    box-shadow: 0 4px 12px rgba(153, 27, 27, 0.18);
    transition: all 0.25s ease;
}
.global-past-due-banner.is-hidden {
    display: none !important;
}
.gpdb-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.gpdb-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.gpdb-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    color: #fef08a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.gpdb-text-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 13.5px;
    line-height: 1.45;
}
.gpdb-title {
    font-weight: 700;
    color: #ffffff;
}
.gpdb-desc {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 400;
}
.gpdb-desc strong {
    color: #fef08a;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.gpdb-card-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 11.5px;
    font-weight: 600;
    color: #ffffff;
    margin-left: 4px;
}
.gpdb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.gpdb-btn-complete {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-radius: 8px;
    border: none;
    background: #ffffff;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}
.gpdb-btn-complete:hover:not(:disabled) {
    background: #fef2f2;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}
.gpdb-btn-complete:disabled {
    opacity: 0.7;
    cursor: wait;
}
.gpdb-btn-cards {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.gpdb-btn-cards:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}
.gpdb-btn-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 2px;
}
.gpdb-btn-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

@media (max-width: 991px) {
    .global-past-due-banner {
        padding: 10px 16px;
    }
    .gpdb-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .gpdb-actions {
        justify-content: flex-end;
    }
    .gpdb-btn-complete {
        flex: 1;
        justify-content: center;
    }
}
